与 c++ 作斗争Linux 上的 IDE
嗨,我真的很沮丧,首先我不知道如何编写非常复杂的代码(make 文件),所以我使用 IDE 来简化我的工作,比如(netbeans、eclipse、Kdevelop .. 等)我几乎尝试过一切都从
- Emacs 开始(我速度很慢,我需要自动完成)
- Netbeans 6.9.1(崩溃,编辑器非常慢,但项目创建令人惊奇且非常容易)
- Eclipse(快速编辑器,我什至讨厌项目配置在 php 中,这太烦人了)
- Kdevelop(我什至无法通过 Hello world ,配置和 Cmake 问题“未指定可执行文件”:S :S
- 代码块没有那么多人推荐它
- anjuta 代码完成确实是
你可能认为的 sux我很懒,或者很快就放弃了,但我发誓我已经搜索了很多,并阅读了每个教程的教程,这些教程中充斥着很多没有人需要的入门信息。而且我认为我们确实缺乏良好的文档在编程世界中,你可以在(Boost库网站)中看到这一点,我真的希望有人能给我一些有用的方法,帮助我度过这一切。
要么我最终会阅读我不需要的 CMAKE 详细信息,并记住 EMACS 快捷键 (CTRL x CTRL bla bla),并在 2010 年放弃舒适易用的 IDE 的想法!
值得庆幸的是,在获得了非常好的答案之后,我认为我必须阅读有关 CMAKE 和 makefile 概念的内容。那么我的一半问题就会消失,而且我认为现在使用 IDE 让我无法理解“Make”的东西不会有帮助,因为我正在计划在 Linux 上进行长期开发,
感谢您的精彩简单答案。
ps(Qt 创建者太棒了!它非常像 MAC,整洁、干净且用户友好)
10 天后:继续老派并使用 EMACS 和 CMAKE
许多周后:伙计们 Eclipse 是最好的!严重地 :) Emacs 很好,但对于想要提高写作技巧的初学者来说,可能会如此,但过了一段时间,这将是一项乏味的工作,您需要快速完成工作!
我不知道为什么我回到这里,我想这是我最喜欢的问题,一年了,是的,我仍在使用 Eclipse,我发誓这不是宣传(年期废话)我真的很喜欢 Eclipse 并且支持它,它是免费的而且仍然令人惊叹的事实让我捍卫它,Eclipse 现在是我的游乐场,但仍然不是它的专家,无论如何我不应该再写了,因为它会变成博客或其他东西,
就像说不要轻易放弃事情,它可能会节省你很多时间。
10年后(2020年),intellij + shell一路走来,但老实说很遗憾没有学习emacs。
hi I'm really frustrated, First I have no idea how to code the very complex (make files), so I'm using IDE's that would ease the job for me like (netbeans , eclipse ,Kdevelop .. etc) i almost tried every thing starting with
- Emacs (i'm very slow on it and I need autocompletion)
- Netbeans 6.9.1 (crashes , very slow editor,but amazing and very easy in project creation)
- Eclipse (fast editor, i just hate the project configurations even in php it was so annoying)
- Kdevelop(I couldn't even get through the Hello world , configuration and Cmake issues "no executable specified " :S :S
- code blocks not so many ppl recommends it
- anjuta the code completion really sux
you might think i'm lazy or give up quickly but I swear I've searched alot and read the pooooooor tutorials of each one that is bloated with much information that no body needs for getting started.And I think we're really in lack of good documentation in the world of programming. and you can very much see that in (Boost library website) I really hope someone gives me helpful method on how to survive all this mess.
either I'll end up reading CMAKE details that i don't need , and memorize EMACS short cuts (CTRL x CTRL bla bla) and give up the idea of the comfortable easy to use IDEs in 2010 !
After thankfully very good answers , I think it's a must That I read about CMAKE , makefiles concepts. then half of my problems will go away , And I think now using IDE's that blind me from understanding the "Make" things isn't going to be helpful as i'm planning for long term development on linux
thanks for the brilliant simple answers.
p.s (Qt creator is awesome !! it's so much MAC like neat, clean and user friendly )
10 days later: goin old school and using EMACS and CMAKE
Many weeks later: Guys Eclipse Is the best ! seriously :)
Emacs is fine but maybe fore a starter who wants to sharpen his writing skills but after a while it will be tedious work and you'll need to get things done fast !
I don't know why I came back here, I guess this is my favorite question, One year now and yes I'm Still using Eclipse, I swear this is not a publicity (year period duh noway) I just really like eclipse and support it, the fact that it's free and still amazing is what makes me defend it, Eclipse now is my playground still not expert in it, anyway I shouldn't write anymore cause it's going to turn into a blog or something,
Just like to say don't give up on things at first easily it might save you hell of a time..
10 years later (2020), intellij + shell all the way, but honestly regret not learning emacs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
也许你可以尝试qt Creator,它是为开发QT应用程序而设计的,但是你可以将它用于其他C++程序。它支持cmake。
maybe you can try qt creator, it designed for developing QT application, however you can use it for other c++ program. It supports cmake.
您对 code::blocks 的看法是错误的。
我已经尝试了您列出的大部分内容,但最终还是使用了 code::blocks。
[编辑]
如果您确实对简单的 UI 开发感兴趣,请查看 Ultimate++
You are wrong about code::blocks.
I've tried most of what you list, but ended up, and is now using code::blocks.
[edit]
If you are really interested in easy UI-development, look at Ultimate++
我发现这些 IDE 在 Linux 上很有用:
顺便说一句,如果您计划将来进行更多 Linux 开发,那么了解 make 文件是必须的。为了帮助您入门,这里是最简单的示例:
注意:在
g++ ..
行前面使用实际的 TAB 而不是 4 个空格。就是这样。
I found these IDE's useful on Linux:
Btw, if you plan to do more Linux development in the future then understanding make files is a must. To help you get started, here's the simplest example:
Note: use an actual TAB instead of 4 spaces in front of the
g++ ..
line.That's it.
对于 emacs,您可以尝试 cedet-语义(代码完成),ecb(代码浏览器)和 yasnippet。
for emacs, you can try cedet-semantic(code completion), ecb(code browser) and yasnippet.
对于 emacs 中的自动完成,我使用(在我的 .emacs 文件中):
它需要至少三个字符,然后向后搜索第一个类似命名的标记。 (您可能还想启用字体锁定和 C++ 模式。)
Emacs 确实有很长的学习曲线。但它非常强大,非常可定制,而且非常有用。您始终可以从命令的一小部分开始,然后从那里开始发展。有一个内置的教程模式(Ctrl-h t)。 (Ctrl-h B) 或 (Ctrl-h k) 之类的东西将帮助您了解各个按键的作用。
对于简单的测试程序,要在 TCSH 下编译,我使用:
对于更复杂的系统,makefile 是必不可少的!在 Linux 的 Fedora(和其他风格)下通过 emacs“info”有关于 GNU-Make 系统的非常好的文档。或者尝试:
http://www.gnu.org/software/make/manual/ make.html
总的来说,makefile 随着时间的推移会变得复杂。他们通常不会那样开始。我们有一组源文件。通常通过简单的替换规则从这些源文件派生的一组目标文件。从这些目标文件的子集派生的库。从各种目标文件和库派生的二进制文件。也许测试在这些二进制文件上运行的程序。也许我们想要将测试程序与回归测试进行比较的测试输出。也许我们想要将一组文件打包到 tarbar 中。也许是我们在清理时想要删除的文件集。等等,
规则很简单。您可以定义数据集(通常是文件名)、应用命令集从现有数据(文件)创建新数据(通常是文件名)的规则以及依赖关系,以便您知道何时重新创建。
说真的,阅读手册,从简单的开始,然后从那里构建...
PS:尝试将这些规则(不是第一条规则!)添加到您的(GNU)makefile:
现在您可以说“make echo-CC”之类的内容查看变量 CC 的设置。它对于调试很有用...
永远记住规则后面的行以制表符开头!
For autocomplete in emacs, I use (in my .emacs file):
It needs at least three characters, and then searches backwards for the first similarly named token. (You may also want to enable font-locking and C++ mode.)
Emacs does have a long learning curve. But it is quite powerful, extraordinarily customizable, and extremely useful. You can always start with just a small subset of the commands and grow from there. There is a built-in tutorial mode (Ctrl-h t). And things like (Ctrl-h B) or (Ctrl-h k) will help you find out what various keys are doing.
For simple test programs, to compile under TCSH, I use:
For more complex systems, makefiles are essential! There's very good documentation on the GNU-Make system via emacs "info" under fedora (and other flavors) of linux. Or try:
http://www.gnu.org/software/make/manual/make.html
By and large, makefiles become complex over time. They don't often start out that way. We have a set of source files. A set of object files derived from those source files, often via a simple substitution rule. Libraries derived from subsets of those object files. Binaries derived from various object files and libraries. Perhaps test programs that run on those binaries. Perhaps test-output that we want to compare the test programs against for regression testing. Perhaps sets of files we want to package up into a tarbar. Perhaps sets of files that we want to remove when cleaning up. Etc.
The rules are simple. You define sets of data (typically filenames), rules for applying sets of commands to create new data (again, typically filenames) from existing data (files), and dependencies so you know when to recreate.
Seriously, read the manual, start out simple, and build from there...
PS: Try adding these rules (not as the first rule!) to your (GNU) makefile:
Now you can say things like "make echo-CC" to see what the variable CC is set to. It's useful for debugging...
Always remember that the lines after the rule start with a tab!
嗯..您检查过您安装的 JVM 版本吗?我同时使用 Eclipse(带有 CDT)和 Netbeans(恕我直言,这是一个出色的 C++ IDE)。我在使用 Eclipse 时遇到了问题(通常索引数百个文件有时会导致内存不足,但您可以使用命令行选项来控制 JVM 可以使用的内存量来解决这个问题)。
为了自我提高,我建议你阅读有关 makefile 的教程,那里有很多,而且 google 是你的朋友。无论 IDE 在生成 makefile 方面有多出色,通常如果您向存储库提供源代码,则很难使用生成的 makefile。
Hmm.. Have you checked which version of the JVM you have installed? I use both Eclipse (with CDT) and Netbeans (this is a brilliant C++ IDE IMHO). I've had issues with Eclipse (typically indexing hundreds of files can sometimes cause it to run out of memory, but you can get around that using command line options to control how much memory the JVM can use).
For the sake of self improvement, I suggest you read a tutorial on makefiles anyway, there's lots out there and google is your friend. Irrespective of how good an IDE is at coming up with makefiles, typically if you're contributing source to a repository, it's difficult to use the generated makefiles.
我也尝试过几个IDE。包括日食和一切。最后我只保留了 emacs(X 版本)和 automake/autoconf。对我来说,这是创造事物的快捷方式。此外,它几乎适用于每台机器,并且大多数时候已经安装或易于安装。
我同意它有一个陡峭的学习曲线,但是当您最终拥有一个简单的 hello world 类型的应用程序时,您可以将 makefile 重用于更大的项目。
对于 automake/autoconf,我使用以下站点来学习它:
对于 emacs,我只是按照包含的教程进行操作。此外,您不需要记住那么多击键即可开始使用 X 版本的 emacs。
(顺便说一句:此处询问了 emacs 的自动完成功能)
I also tried several IDEs. Including eclipse and everything. In the end I just stayed with emacs (the X version) and automake/autoconf. For me it is the fasted way to create something. Also, it works on almost every machine and is most of the time already installed or easy to install.
I agree it has a steep learning curve but when you finally have a simple hello world type of application you can reuse the makefiles for bigger projects.
For automake/autoconf I used the following sites to learn it:
For emacs I just followed the included tutorial. Besides, you do not need to remember that much key strokes to begin using the X version of emacs.
(BTW: autocompletion for emacs is asked here )
虽然你正在寻找与 IDE 相关的东西并生成 make 文件.. 等等.. 我更喜欢“vim”的简单性和语法高亮
Although you are looking for something related to an IDE and generating make files.. etc.. I prefer the simplicity and syntax high-lighing of "vim"
你应该再尝试一下 kdevelop,它真的很值得! 4.x 版本提供了非常好的 C++ 代码完成和编码帮助。
我认为你的问题是,你必须首先为你的“Hello world”示例创建一个“启动配置”(看看运行->配置启动...)
You should give kdevelop another try, it is really worth it! The 4.x versions offer a very good C++ code completion and coding assistance.
I thing your problem is, that you have to create a 'Launch Configuration' for your 'Hello world' example first (have a look at Run->Configure Launches...)
另一种方法是考虑使用好的编辑器,并将其与使用半自动构建系统结合起来
经典的是 autoconf / automake .... 如果您打算编写真正可移植的东西,那么这就是您应该去的地方。它的学习曲线很陡峭,但很有效。它是开源的通用构建系统
,
boost有一个名为jam的构建系统,这非常好
我确信还有其他人
记录在案我将 slickedit 与 auto* 和普通 ole gdb 一起使用
the alternative is to look at using good editors and combine this with using semi automatic build systems
the classic is autoconf / automake .... if you plan to write truly portable stuff then this is the place to be. It has a steepish learning curve but works. It is the universal build system of open source
boost has a build system called jam, this is very good
I am sure there are others
For the record I use slickedit with auto* and plain ole gdb
我也经历过同样的痛苦。我想同时使用 Windows 和 Linux 版本,这样我就可以进行跨平台工作。
我可能最终会尝试选择一个可以交叉编译的更好的IDE。
I went through the same pain. I wanted to use both the windows and linux versions so I could do cross platform work.
I may end up trying to pick a better ide that can cross compile instead.
Kdevelop版本4仍然不够稳定。在4.0版本(ubuntu 10.10附带)中,执行按钮始终是灰色的,并且总是崩溃。
尝试版本 3 - 非常好。
Kdevelop version 4 is still not stable enough. In version 4.0 (that comes with ubuntu 10.10) the execute button is always gray, and it crashes all the time.
Try version 3 - it is very good.