您使用哪些工具在 Linux 上开发 C++ 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17228/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 16:21:20  来源:igfitidea点击:

What tools do you use to develop C++ applications on Linux?

c++linuxeclipsegdbvalgrind

提问by Clayton

I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind.
What tools do other people use? Is there anything out there for Linux that rivals the slickness of Microsoft Visual Studio?

我在 Linux 环境中开发 C++ 应用程序。我每天使用的工具包括带有 CDT 插件的 Eclipse、gdb 和 valgrind。
其他人使用什么工具?Linux 有什么可以与 Microsoft Visual Studio 的流畅性相媲美的吗?

回答by andrewrk

g++ and make

g++ 和 make

回答by fulmicoton

I believe KDevelop is what would be the closest from Microsoft Visual Studio. You get pretty much everything (except unfortunately VS debugger which is indeed a killer). Its already mature and its development is pretty fast and promising.

我相信 KDevelop 是最接近 Microsoft Visual Studio 的。你几乎得到了一切(除了不幸的 VS 调试器,它确实是一个杀手)。它已经成熟,并且发展非常快且有前途。

It actually implement a few stuff you won't even see in VS. For instance, open header file and cpp file in vertical tile mode, and have the cursor synchronized in both, ie: when you select a functions prototype, you always have its implementation on your right.

它实际上实现了一些你在 VS 中看不到的东西。例如,在垂直平铺模式下打开头文件和 cpp 文件,并在两者中同步光标,即:当您选择一个函数原型时,您总是在您的右侧看到它的实现。

KDevelop is a KDE project, but run on Gnome. Anjuta is an equivalent project on Gnome, but I find it unusable for real work. For the rest of the stack gcc make valgrind ddd (a gdb IDE) and python for scripting my code.

KDevelop 是一个 KDE 项目,但在 Gnome 上运行。Anjuta 是 Gnome 上的等效项目,但我发现它无法用于实际工作。对于堆栈的其余部分,gcc make valgrind ddd(一个 gdb IDE)和 python 来编写我的代码。

If you're ok to try a different approach than the VS IDE. You may consider trying vim. It takes a long time to get used to it though.

如果您可以尝试与 VS IDE 不同的方法。你可以考虑试试vim。不过需要很长时间才能适应。

回答by Adam

g++ of course, but also Code::Blockswhich is an absolutely fantastic cross platform IDE (Win32, *nix, Mac).

当然还有 g++,还有Code::Blocks,这是一个绝对出色的跨平台 IDE(Win32、*nix、Mac)。

I use the nightly (more like weekly lately) builds from the SVN. It has almost all the bells and whistles you would expect from a modern IDE. It's really a truly fantastic Open Source project.

我使用来自 SVN 的每晚(最近更像是每周)构建。它几乎具有现代 IDE 所期望的所有功能。这真的是一个非常棒的开源项目。

Also, on Linux you get the joy of using Valgrindwhich is probably the best memory tracker (it does other things as well) tool that money can buy. And it's free :) Track down memory leaks and more with ease.

此外,在 Linux 上,您可以享受使用Valgrind的乐趣,这可能是金钱可以买到的最好的内存跟踪器(它也可以做其他事情)工具。而且它是免费的 :) 轻松追踪内存泄漏等。

And there is just so much more! Linux is such a great dev platform :)

还有更多!Linux 是一个非常棒的开发平台 :)

(edit) Just realized you mentioned Valgrind in your question, silly me for reading it too fast.

(编辑)刚刚意识到你在你的问题中提到了 Valgrind,我读得太快了。

回答by OJ.

Anjutais a nice idea that makes Linux C++ dev quite enjoyable as well.

Anjuta是一个不错的主意,它也让 Linux C++ 开发变得非常有趣。

回答by Pat Notz

Eclipse CDTis really quite nice. I still have to resort to Emacs from time to time but I really love the indexing, call trees, type trees, refactoring support (thought it's nothing like Java refactoring), etc. Syntax highlighting is quite powerful if you customize it (can have separate colors for local variables, function arguments, methods, etc.). The code completion is really handy too. I've mostly used Eclipse 3.3 but 3.4 is great too.

Eclipse CDT真的很不错。我仍然需要时不时地求助于 Emacs,但我真的很喜欢索引、调用树、类型树、重构支持(认为它不像 Java 重构)等。如果你自定义它,语法突出显示非常强大(可以有单独的局部变量、函数参数、方法等的颜色)。代码完成也非常方便。我主要使用 Eclipse 3.3,但 3.4 也很棒。

Also, mostly I'm using this for a somewhat large project (~1e6 sloc) -- it may be overkill for toy projects.

此外,我主要将它用于一个有点大的项目(~1e6 sloc)——对于玩具项目来说可能有点过头了。

回答by Yuval F

When I developed C++ code on linux, I used emacs as an editor and as a gdb front-end. Later, my company purchased SlickEditfor all of the programmers, which is a nice IDE, maybe not on a par with Visual Studio. We used gdb extensively, with the occasional use of valgrind and gprof. I highly recommend using a scripting language to complement C++ on day-to-day tasks. I went from PERL to python to the current ruby. All of them get the job done and have strengths where C++ has weaknesses. And, of course, you have all the shell commands at your disposal. I daily use sort(), uniq(), awk, etc. And one more recommendation is ack, a grep successor.

当我在 linux 上开发 C++ 代码时,我使用 emacs 作为编辑器和 gdb 前端。后来,我公司为所有程序员购买了SlickEdit,这是一个不错的 IDE,可能无法与 Visual Studio 相提并论。我们广泛使用 gdb,偶尔使用 valgrind 和 gprof。我强烈建议在日常任务中使用脚本语言来补充 C++。我从 PERL 到 python 再到当前的 ruby​​。他们都完成了工作,并在 C++ 的弱点中发挥了优势。而且,当然,您可以使用所有 shell 命令。我每天都使用 sort()、uniq()、awk 等。另外一个推荐是ack,它是 grep 的继任者。

回答by Patrick Loz

I'm another for KDevelop. It has a very diverse set of tools. I'm not real familiar with VS and whether or not it has integrated console access via its interface, but KDevelop can allow you to run a konsole inside the IDE, which I always find very useful. You could always give Netbeans a go now that it has full C/C++ support.

我是 KDevelop 的另一个人。它有一套非常多样化的工具。我不太熟悉 VS 以及它是否通过其界面集成了控制台访问,但是 KDevelop 可以允许您在 IDE 中运行 konsole,我总是觉得这非常有用。您可以随时试用 Netbeans,因为它具有完整的 C/C++ 支持。

Other than that, I make good use of gdb and its gui-based version ddd for problems with the code or other bugs. For throw-away programs, like others that already posted - I use g++ at the terminal and make for some larger projects.

除此之外,我很好地利用了 gdb 及其基于 gui 的版本 ddd 来解决代码问题或其他错误。对于一次性程序,就像其他已经发布的程序一样 - 我在终端使用 g++ 并为一些更大的项目制作。

回答by zhengtonic

When develop C++ apps for linux, i prefer using a bunch of cmdline tools. Vim extended with a lot of plugins. Gdb with ddd, valgrind, libefence and SCons (automake is a pain in ... you know where)

在为 linux 开发 C++ 应用程序时,我更喜欢使用一堆 cmdline 工具。Vim 扩展了很多插件。带有 ddd、valgrind、libefence 和 SCons 的 Gdb(automake 是一种痛苦......你知道在哪里)

回答by lothar

Eclipse CDT for editing, SVN for source control, SCons for build management, CruiseControl for automated builds and a proprietary unit test framework.

用于编辑的 Eclipse CDT、用于源代码控制的 SVN、用于构建管理的 SCons、用于自动构建的 CruiseControl 和专有的单元测试框架。

回答by Rob

I use the NetBeans C++ plugin, which is superb and integrates with CVS and SVN. The project management side is also very good. I was up and running with it in minutes. It's an impressive IDE but being Java, can be a little sluggish.

我使用 NetBeans C++ 插件,它非常棒,并且与 CVS 和 SVN 集成。项目管理方面也很好。我在几分钟内就启动并运行了它。这是一个令人印象深刻的 IDE,但作为 Java,可能有点迟钝。