C++ development on linux Code::Blocks, EMACS or GVIM [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am not looking for an IDE suggestion for C++ development. I have found many discussions on that and tried EMACS, GVIM and Code::Blocks. I liked Code::Blocks very much than the other two. But it looks like most of the developer community is using tools like EMACS or GVIM. Is there a reason for this? Why Code::Blocks is less used?
I found EMACS and GVIM is less user friendly. You have to put more effort to get it working, but Code::Blocks take advantage here. It is easy to start and compile. Or do I miss something?
Thanks

Whatever editor you ultimately end up using, it is worth taking a few minutes to at least learn to navigate around and perform basic editing tasks in Vim, since a vi of some flavour is the most commonly available editor in especially the more specialised distros.

Code::Blocks is less used because it isn't extensible as Emacs & Vim. During my work (in Emacs) with different programming languages, i often create a new scripts that make my work much easier. Code::Blocks allows to write extensions only in C++, that requires to do lot of work.

Code::Blocks is a new entrant. Vim and Emacs on the other hand have been present for much longer. They are the original text-editors. These were written when there was no GUI and have evolved with time. GUI has been later on added to these; GVim is one example. Like any other modern GUI-based IDE Code::Blocks hides the strange command-line invocations from you thereby making it more user friendly -- for those who were brought up on a heady mix of rich OS UI :-)

Lots of developers use EMACS and vim because they're excellent and powerful editing tools that, once learned, can make everyday editing tasks much simpler. Neither is specifically an IDE in the same sense as Code::Blocks. EMACS and Vim are just editors, but because of their usefulness and their longevity they've accumulated a number of plugins and extensions to simulate many of the tasks of an IDE.
As for which you would like to learn, it's up to you. If you just want an IDE that lets you jump right in, you're probably not looking for Emacs and Vim, but if you want a very powerful editor that, while taking a while to learn, will make your life easier in the end, go for Emacs or Vim.

Vi(m), Emacs are everywhere on the linux machines. They are very extendable and can satisfy any project need. As almost all projects (at least at our company) at the linux are very big projects for support you need a serious configurable tool to accomplish the task. You don't need IDE to fast create small projects. One project. One configuration. Years of work.
Plus. With Vim or Emacs you can do it remotely and fill ok.

Code::Blocks is a nice IDE but most linux OSS projects don't want to be IDE dependant and are so written that anyone who can drive an editor and use make can build them. If you are going to be doing serious work on Linux you need to learn one of vim or emacs. This is not to say that you can't use Code::Blocks for your own projects of course - I certainly do!

Personally, I switch the IDE of choice every now and then. For example, I've used Code::Blocks for some years, but skipped it now as for some reason the editor window has got an increased latency that let me type whole phrases into the blind; and I already disabled all time consuming stuff (I anyways don't use frequently) like code completion (that is, on my Debian GNU/Linux installation; on Windows I still love code::blocks).
So, I recently stumbled over Monodevelop, and even though I am not the biggest fan of mono/.net, that IDE is really nice and extendible. It has a class browser and a filesystem browser, and some more features I personally don't use (it's primarily an mono/.net IDE, but also supports C++ really nicely). The only thing I don't like on monodevelop is that it isn't scintilla based, or that it cannot be tweaked to be like scintilla (I am a heavy user of it's copy+paste mechanisms) (*).
I usually don't compile inside an IDE, as that is often painful when it comes to distributing your app or porting it to other operating systems (I use makefiles or CMake instead). Also, having a (fullscreen) console/terminal-window handy for compilation is really nice if your app dumps a lot of log, or when your compiler dumps epic error messages.
(*) For example, you can press CTRL+D to just duplicate the marked text right behind the current cursor position. To get a glimpse on it, look at Notepad++ (win) or Scite (Linux).

Related

Why there are no good open-source development tools? Shouldn't it be a priority for the community? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
My native language is not english, so please sorry my mistakes.
I'm doing a course of free technologies and recently I've been learning Linux and it seems promising, however, I couldn't find good development tools, something like Visual Studio.
After trying a lot of other IDEs, none of them gets close to MSVS functionality.
I know it's not easy to develop a good IDE, but there are dozens of "almost-there" IDEs, I wonder what they could do if the developers had joined efforts.
Also, I'm just wondering... Why the open-source community doesn't have a good IDE on top of the priority list.
After researching a little, I found a lot of articles describing how the OS community works, they always break apart, when things are getting usable they just dissipate and begin to work on more unusable things.
This made me very sad, because I thought open-source were serious stuff, and that's why I choose the course on free technologies, now I'm almost decided to give up.
There are hundreds of Linux distros, and hundreds of similar software that does almost the same thing, from desktop environments to python scripts, people are reinventing the wheel. Open-source is quantity and not quality.
If I can't find a good C++ IDE that has the features I'm used to, I'm going to give up. I'm not a genius geek, just a normal or maybe dumb guy who programs in C++ and is used to tools that facilitate the development. Emacs, Vim, all that stuff is too much for me. If that were the only tools available for programming, then programmers would be the rarest persons in the world because you need to be a super-genius to use these tools.
The features I want in a C++ IDE are:
-Good code highlighting
-Pop-up documentation
-Good debugger with visual aid
-Usable and smart code completion
Thank you.
I think what you're encountering is a difference in culture. Surely there would not be the amount of free and open source software that exists if nobody had the tools to develop it. But the people who are developing it are mostly used to a very different flavor of tools that what folks brought up on Visual Basic are used to. Emacs, ctags, make, gdb, strace, ltrace, and so on are all very powerful and much more natural to somebody used to unix than a MS-style IDE... and I hesitate to simply say IDE, because many FOSS developers consider emacs itself to be an "IDE".
Perhaps your question would be more productive and less inflammatory if you instead asked "Why are there no open source MSVS-like IDEs?"
I agree with Diego Sevilla comment.
My first experience as developer was with Visual Studio and that skew my way of work.
Like my mind was trying to use something equals to Visual Studio, but that is only an habit.
After Visual Studio I moved to Eclipse, I loved it! at that times with visual studio and subversion you needed an external tool! (today exists some tools out there).
Now I am using vim, why? ultra fast, customizable and minimal (if you want).
But the best best example of open source IDE is smalltalk, I wish all programming lenguage came with the tools smalltalk provide.
Um, get Eclipse or Netbeans. Both are great free IDEs with millions of users.
There are many open source IDE's. Check out http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments You can see some of the licenses.

What is the easiest C++ IDE for students, non-programmers? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I teach programming at secondary school: this is our current status and I would appreciate any suggestions:
We have programmers club for advanced students. We develop in MSVC# (even commercially) and NetBeans, everything works fine
However, two thirds of the class are not developers: they are otherwise oriented, their job will probably not be in IT
According to our school agenda, we HAVE TO teach them some basics
So in the first year of their studies, we teach them something like "programming for dummies" to give them time to decide what they really want to do (programmers club requires to do MUCH homework)
The language HAVE TO BE C++ (for many reasons). Currently they develop in C++ Builder 6.0, which is slow and buggy in our school network.
So what would be the best solution for those students? The requirements are fast, reliable and very easy to undestand IDE. Console output is sufficient, something like "editor and play button". Visual programming and debugging tools are not required. The IDE should be free, preferably running on Windows.
My favorite was MSVC 2008 Express - it is really fast and pretty simple. But C++/CLI is not C++ (managed code is not the basics), so this is not an option. Any other suggestions?
You said it right there: go with Visual C++ Express.
Just because you can use it to write C++/CLI projects doesn't mean you have to. Just create ordinary Win32 console apps and you'll be using plain old C++, nothing managed whatsoever.
To clarify: C++/CLI is what you get when you create a Windows Forms, Windows Presentation Foundation or some other type of .Net-based application. If you create a Win32 Console Application, you will be using ordinary C++ without any of the managed Microsoft extensions.
Visual C++ Express does support native C++ developement. I would strongly urge you to upgrade to the 2010 version to gain some C++0x support; C++0x makes it much easier to program in C++ without touching the nasty bits.
However, C++ as a first language sounds daunting. Particularly for those without any further programming aspiration; it's complicated, easy to misuse, and will blow up with poor error handling in hands of beginners.
For some casual programming introduction, I'd recommend something like JsFiddle: they can do it from anywhere with no special tools, and whatever they learn they might even be able to actually use as non-IT guys. It's also much more fun to get immediate feedback when learning something, which is another mark against C++.
So if you have to use C++, use C++0x to make stl algorithms "just work" using lambdas and avoid iterator complexity using the range-based for (amongst other improvements).
I've worked with:
Eclipse for C/C++ Developers (at work and at home)
QtCreator (at a side project I was working on while working)
Microsoft VS (at work)
Code::Blocks (on my home laptop, with Eclipse, for fun)
vi (at work and at home)
Notepad++ (at home)
KDevelop (at home)
I think for the beginner, in my personal opinion of course, the Eclipse, MSVS and Code::Blocks are equally great. When stuff starts getting more complicated, you need to choose based on direction. If you're developing for Windows - stick with MS. If you're developing with GCC - stick with either Eclipse (Which is kindof heavy but powerful) or Code::Blocks (which is way lighter but not as sophisticated). Use QtCreator if you're doing GUI for anything with Qt, otherwise I wouldn't keep it.
Code::Blocks is the one I usually recommend for beginners. I'm not a big fan of the Eclipse CDT since I've always found it needlessly complex under Windows.
Since it uses gcc under the covers, you won't find any of those "helpful" changes Microsoft made to the language, like their so-called safe functions, which are nothing of the kind, and which render your code unportable.
If you don't want to scary students with nasty or bulky look of IDE. Choose qt-creator. It's looks nice. Looks simple, but at the same time is very powerfull.
I would have to recommend QtCreator, and it's a good thing to teach them to use a cross-platform GUI toolkit.
It sounds like you want Eclipse for C/C++ Developers.

Netbeans or Eclipse for C++? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'm currently working on a pet project and need to do C++ development on Windows, Mac, Linux, and Solaris, and I've narrowed it down to Netbeans and Eclipse, so I was wonderig which is more solid as a C++ editor. I just need solid editing, good autocompletion for templated code ad external libraries, and project file management, the build tools are external, so thats irrelevant here, for my comparison.
Thus which is a better choice?
Note: I know I should be using emacs or vim, but the issue is, my theory at least, that I'm left handed, so I use my right side (design,creativity) of the brain more than the left side (logic, memory), so I just simply cannot use emacs or vim, my brain simply isn't compatible, I tried them many times too, even used emacs for a few months but it drove me crazy...
Thanks
I haven't used NetBeans, but Eclipse CDT (C Developer Tools, which includes C++), especially with the latest version, is really quite excellent:
Syntax checking and spell checking
Syntax highlighting that distinguishes between library calls and your function calls and between local and member variables and is even applied to code that's #ifdef'ed out
Macro expansion that can step you through each level of macro application or show the final result even of very complex Boost Preprocessor macros
A file and class outline view that updates dynamically to show where you are in a file. (Commercial IDE's I've used fail to do this.)
Powerful, flexible Find/Replace and Find in Files features with complete Perl-style regex support. It's also supposed to be able to do a C/C++ Find in Files that can search based on language semantics (e.g., only find references, not declarations), although this sometimes doesn't work for me.
Automatic tracking of TODO and other comment tags
Mouseover tips that show the exact declaration of a variable or function, including any comments, instead of just where a variable or function is declared. (Again, commercial IDE's I've used fail to do this.)
Support via plugins for Subversion, Doxygen, etc.
Some refactoring support - rename, extract constant, extract function, a few others
Code reformatter, based on user-definable code styles
You'd asked specifically about its editor; the Eclipse editor is good enough that I use it in preference to the commercial IDE for our product whenever I don't need the commercial IDE's forms designer.
Eclipse's debugger integration (using gdb) is tolerable but not great, and its memory usage is high. A few features (like the C/C++ Find in Files) don't work reliably or require reindexing (which is time consuming) for no apparent reason, but the latest version seems more reliable in this regard.
Can someone who's used NetBeans fill in how it compares?
I'm using Netbeans from time to time on Solaris and the latest (6.5) version is pretty neat. It has all the features that you need, perhaps autocompletion could work better, but I have a really bad code base so it might be the result of it. Keep in mind that you need strong machine for that, if it's your PC it's ok but Netbeans on a remote server (like I tried) is really slow unless you have a decent hardware. There are few simple refactorings for C++ with nice preview option, definitely worth a try.
You can get a whole Sun C++ pack from here:
http://developers.sun.com/sunstudio/downloads/express/
Personally I prefer NetBeans - the project management is excellent and I was up and running quicker than with Eclipse. However, it is subjective and YMMV.
They are both bloated and slow, IMHO. Why don't you try Code::Blocks instead? It is specifically aimed at C++ developers and performs much better than either Eclipse or NetBeans.
Just to give 2 cents to the comments about speed or performance issues with eclipse/netbeans:
The only part of an IDE that sucks if it is slow is the editor component.
And in contrast to some obviously superficial assertions here, I found the editor
component in Eclipse extremely snappy. The rest of the IDE is prone to lags,
but the editor itself delivers spotless performance.
I have a 1.4GHz Laptop and use Eclipse with it. Eclipse's editor component is faster (especially when scrolling/browsing through text) than Code::Blocks or KDevelop. The simple reason for this is: Eclipse caches everything, especially the syntax highlighting etc., other IDEs seem to try to do this ''live'' and fail.
The c++ indexer was a cause of woe in versions past. It crashed when out of memory, without it none of the nifty search functions worked, etc.
For the current version I can only say: It is all fixed and it works like a charm.
It's speed is comparable to the VisualStudio Indexer.
If you install Eclipse CDT you get a ton of nice features as has been explained in other replies already, that most other IDEs only provide with multiple plugins. (I don't know about netbeans, never used it.)
The feature that kicks me everytime is the smart tooltip when I hover over some identifier. Eclipse gives me direct access to any javadoc that might be entered somewhere and the file where it is defined and even lets me scroll around inside the tooltip!
So I have every identifiers full context at my fingertips, everywhere.
I prefer it over Visual Studio and pretty much everything else I've tried.
Granted, everything else you do in the IDE could be snappier. For me, the crucial thing is, that the editor is fast and eclipse's definitely does a great job there.
The only thing I hate about Netbeans is that the debugger is kinda slow in comparison to Eclipse . Besides that , Netbeans would be my choice .
If you run eclipse under linux you can use valgrind for memory leaks. Eclipse supports gdb well enough for me, but I couldn't find a decent memory leak plugin, and the valgrind integration plugin is in beta. This blog does a great tutorial for it: http://kapo-cpp.blogspot.com/2007/02/detecting-memory-leak.html . I cast my vote for eclipse on linux. P.S Real men use ed only.
The c++ parser in code::blocks doesn't seem to be on par with netbeans and eclipse ones: according to code::block's wiki, it needs to be entirely rewritten.
They're both excellent for C++ development, but one thing that I've recently found lacking in NetBeans is that there doesn't seem to be a plugin available for CppUnit, or any other C++ unit testing framework. I'd love to get some more responses to this question if I'm wrong about that.
(Also, I know development is always going on for NetBeans, so maybe someone will come up with a plugin soon.)
For C++ I'd have to agree with Nemanja Trifunovic and say you should give Code::Blocks a look. It's free, and has great performance. I started using it a few years ago after switching from Bloodshed Dev-C++ (which is basically not supported anymore) and couldn't be happier.
I'm a huge fan of Eclipse and have used it extensively for Java and C++ programming. However, currently, it does not support remote C++ development. I tried Netbeans Remote C++ development and have found it to be rather excellent and extremely simple. Having said that, the C++ parsing is not as fluid as Eclipse, the autocomplete sometimes gets in the way and doesn't go away, and the biggest problem I have had is the constant need to restart the IDE due to very slow performance. I hope Eclipse can continue to build it's Remote C++ development capabilities and use Netbeans as an example of how to make it very simple!
having used eclipse for some time now i recently took a look at netbeans and must say i quite like it. at the end of the day they are both excellent ides and it is a very subjective choice.
in my opinion netbeans seems to be a bit faster than eclipse, but that might just be a feeling.
I have been using Net Beans so far. But I was forced to switch to Eclipse due to problems in NetBeans. There is a Net Beans bug which renders the IDE useless when you work with projects with a large amount of source files. Many people have been complaining, but it seems the Net Beans team was unable to fix the problem which stops the IDE from responding when it is parsing the source files. :(
Reported in:
Petr Dvorak - Oracle Blog
As a solution they provide an on-demand parsing mechanism which does not work for me :(
Net Beans Wiki

Cross-platform C++ IDEs? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a good IDE for C++ that has most or all of the following properties (well, the first 4 or 5 ones are mandatory):
cross-platform (at least Mac, Linux)
of course, syntax highlighting and other basic coding editor functionality
reasonably responsive GUI, not too sluggish on mid-size (say, 100 files) projects (both my Linux and Mac computers are 5 years old)
code completion
integration with gdb
SVN integration would be nice too
refactoring (rename a variable semi-automatically throughout the codebase, etc.)
can display class hierarchy
can add hypertext-style links to the code (so you can click on a function/class name and it brings you to the declaration),
can show code parts that (potentially) call my function (I know that's hard to do for C++ so I added the potentially)
So far, I've been using Emacs for everything, but I think advanced features that give me more overview and search capabilities like the last three would be nice. I'm tired of just using grep and find on my codebase.
Basically, I want most of the things for C++ development that Java IDEs usually do.
I see Netbeans can be used for C++, as well as Eclipse. I think they would fit my requirements. Has anyone actually used them for daily coding? What are the differences? What are your experiences? Code::Blocks is more lightweight and doesn't do many of the things listed above, right?
Note: I don't need a GUI builder.
Update: With the bullet point 10 I mean that I can give it a function name (e.g. Foo::setValue), and it shows me all occurrences where this particular function (and not other functions of the same name, like Bar::setValue) is called in my codebase.
Code::Blocks does the first 5 and it's also got class method browsing (though not a heirarchy display). It's a much more lightweight solition thaen Eclipse or NetBeans, but if you like the minimalist approach it's pretty good.
To summarise CB versus your requirements:
Yes
Yes
Yes
Yes
Yes
No - but you can add it easily
No
No, but similar functionality
No
Can go from definition to decl and vice versa, but no callers list
As all the solutions you mention are free, you could always try them all and then make a decision on which one to stick with. That's what I did.
In addition to the ones mentioned, there's QTCreator, which has "Rapid code navigation tools" though I've not used it.
I think though that the non-essential requirements aren't so good, you can easily see where a method is being called using search! (of course, if you have a huge class hierarchy where every class has the same named method, you've only yourself to blame :) if you havn't laid your classes out in an easily understandable way)
I'd recomend Netbeans, in 6.5, its pretty fast IDE and offers all 10 of your requirements.
I recently asked this same question. I ended up choosing Eclipse with the CDT plugin and the Cygwin libraries. I've been pretty happy with it, except I haven't quite got the hang of the debugger. The window for walking through source on the debug perspective is pretty small, for some reason I haven't figured out how to see into arrays, and I think I knocked out one of the windows for displaying variables and don't know how to get it back. I've ended up abandoning the debugger perspective and just walk through debugs in the normal perspective.
Also, I use Eclipse for Java, so the helped minimize the learning curve. It can do refactoring and you can integrate svn.
Java based IDEs (Netbeans and Eclipse) are sometimes somewhat slow. Also their main focus is Java. One problem with Eclipse is that it is difficult to use for small screens, such as in laptops. I prefer to work usually in vim + ctags (to perform the functions of grep and find), and when I have some advanced operations like comparing two directory hierarchies, I use Eclipse. I've not used Code::Blocks much, but I hear good things about it.
Coming from Emacs, I think you'd prefer something lightweight and not heavy-weight. I would consider Code::Blocks then as a good candidate for exploration.
codeblocks is open source !!
http://www.codeblocks.org/
Go for Eclipse. If you have a decent computer, it is fast enough and has best possibilities with its plug-ins.
codeblocks have a lot of features just check them up !
and it is free !
If you already know Emacs, it may be easier to just start using a few more packages, than learn a whole new IDE.
For example, you can easily do #9 with Emacs: just run tags once and then M-. RET anywhere.
You also have to weigh the IDE's features against what you lose. For example, most IDEs don't tend to have Emacs' easy macro capabilities or numeric prefixes, which are often like a more general form of refactoring.
It is not only the IDE that matters - you would probably need to be able to build you application outside of the IDE (i.e. continuous integration).
Consider using CMake to create a cross-platform description of your build scripts. Once you have the CMake Script (which is straightforward) you can generate from it project files for the IDE of your choice - eclipse, kdevelop, Visual Studio, codeblocks, etc.
I would suggest using eclipse as an IDE. There are few options of how to use CMake with eclipse. Play around, and find the best for you.
Once more - CMake is not only cross-platform it is also cross-IDE. And CMake scripts are very readable, a simple make file would look like this:
project(hello)
add_executable(hello hello.cpp)
Now compare that with makefiles, or setting up a project in your favorite IDE!
My two cents (in no particular order ... and not all these options are c++):
Qt ... my first productive GUI building framework
Lazarus ... what a cool name, and very productive tool (not c++ though)
MonoDevelop ... I'm falling in love with c# development (very much like c++)
Java ... ubiquitous ( a bit like c++)
CHEERS!
Sublime Text Editor is the best cross platform editor so far I have seen. Try using it http://www.sublimetext.com/. It comes with unlimited demo period without suppressing any of its functionality. But if you are satisfied with that, please buy and use it to credit the author.

C++ IDE for Linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE?
I could find these SO topics:
Lightweight IDE for linux and
What tools do you use to develop
C++ applications on Linux?
I'm not looking for a lightweight IDE. If an IDE is worth the money, then I will pay for it, so it need not be free.
My question, then:
What good, C++ programming IDE is available for Linux?
The minimums are fairly standard: syntax highlighting, code completion (like intellisense or its Eclipse counterpart) and integrated debugging (e.g., basic
breakpoints).
I have searched for it myself, but there are so many that it is almost impossible to separate the good from the bads by hand, especially for someone like me who has little C++ coding experience in Linux. I know that Eclipse supports C++, and I really like that IDE for Java, but is it any good for C++ and is there something better?
The second post actually has some good suggestions, but what I am missing is what exactly makes the sugested IDE so good for the user, what are its (dis)advantages?
Maybe my question should therefore be:
What IDE do you propose (given your experiences), and why?
Initially: confusion
When originally writing this answer, I had recently made the switch from Visual Studio (with years of experience) to Linux and the first thing I did was try to find a reasonable IDE. At the time this was impossible: no good IDE existed.
Epiphany: UNIX is an IDE. All of it.1
And then I realised that the IDE in Linux is the command line with its tools:
First you set up your shell
Bash, in my case, but many people prefer
fish or
(Oh My) Zsh;
and your editor; pick your poison — both are state of the art:
Neovim2 or
Emacs.
Depending on your needs, you will then have to install and configure several plugins to make the editor work nicely (that’s the one annoying part). For example, most programmers on Vim will benefit from the YouCompleteMe plugin for smart autocompletion.
Once that’s done, the shell is your command interface to interact with the various tools — Debuggers (gdb), Profilers (gprof, valgrind), etc. You set up your project/build environment using Make, CMake, SnakeMake or any of the various alternatives. And you manage your code with a version control system (most people use Git). You also use tmux (previously also screen) to multiplex (= think multiple windows/tabs/panels) and persist your terminal session.
The point is that, thanks to the shell and a few tool writing conventions, these all integrate with each other. And that way the Linux shell is a truly integrated development environment, completely on par with other modern IDEs. (This doesn’t mean that individual IDEs don’t have features that the command line may be lacking, but the inverse is also true.)
To each their own
I cannot overstate how well the above workflow functions once you’ve gotten into the habit. But some people simply prefer graphical editors, and in the years since this answer was originally written, Linux has gained a suite of excellent graphical IDEs for several different programming languages (but not, as far as I’m aware, for C++). Do give them a try even if — like me — you end up not using them. Here’s just a small and biased selection:
For Python development, there’s PyCharm
For R, there’s RStudio
For JavaScript and TypeScript, there’s Visual Studio Code (which is also a good all-round editor)
And finally, many people love the Sublime Text editor for general code editing.
Keep in mind that this list is far from complete.
1 I stole that title from dsm’s comment.
2 I used to refer to Vim here. And while plain Vim is still more than capable, Neovim is a promising restart, and it’s modernised a few old warts.
My personal favorite is the CodeLite 2.x IDE.
see: http://www.codelite.org
The decision to use CodeLite was based on a research regarding the following C++ IDE for Linux:
Eclipse Galileo with CDT Plugin
NetBeans 6.7 (which is also the base for the SunStudio IDE)
KDevelop4
CodeBlocks 8.02
CodeLite 2.x
After all I have decided to use CodeLite 2.x.
Below I have listed some Pros and Cons regarding the mentioned C++ IDEs. Please note, that this reflects my personal opinion only!
EDIT: what a pity that SOF doesn't support tables, so I have to write in paragraphs ...
Eclipse Galileo with CDT Plugin
Pros:
reasonable fast
also supports Java, Perl(with E.P.I.C plugin)
commonly used and well maintained
also available for other OS flavours (Windows, MacOS, Solaris, AIX(?))
Cons:
GUI is very confusing and somewhat inconsistent - not very intuitive at all
heavy weight
Only supports CVS (AFAIK)
NetBeans 6.7 (note this is also the base for the SunStudio IDE)
Pros:
one of the most intuitive GUI I have ever seen
also supports Java, Python, Ruby
integrates CVS, SVN, Mercurial
commonly used and well maintained
also available for other OS flavours (Windows, MacOS, Solaris)
Cons:
extremly slow
heavy weight
uses Spaces for indentation, which is not the policy at my work. I'm sure this is configurable, but I couldn't find out how to to that
KDevelop4 (note: I did not much testing on it)
Pros:
commonly used on Linux
integrates CVS, SVN, Mercurial
Cons:
the GUI looks somewhat old fashioned
heavy weight
very specific to the KDE environment
CodeBlocks 8.02 (note: I did not much testing on it)
Pros:
reasonable fast
Cons:
the GUI looks somewhat old fashioned (although it has a nice startup screen)
the fonts in the editor are very small
some icons (e.g. the debugger related icons starting/stepping) are very small
no source control integration
CodeLite 2.x (note: this is my personal favorite)
Pros:
the best, modern looking and intuitive GUI I have seen on Linux
lightweight
reasonable fast
integrates SVN
also available on other OS flavours(Windows, MacOS, Solaris(?))
Cons:
no CVS integration (that's important for me because I have to use it at work)
no support for Java, Perl, Python (would be nice to have)
Code::Blocks
Eclipse CDT
Soon you'll find that IDEs are not enough, and you'll have to learn the GCC toolchain anyway (which isn't hard, at least learning the basic functionality). But no harm in reducing the transitional pain with the IDEs, IMO.
A quick answer, just to add a little more knowledge to this topic:
You must definitely check out NetBeans. Netbeans 6.7 has the following features:
C/C++ Projects and Templates: Supports syntax highlighting,
automatic code completion, automatic indentation.
It has a C/C++ Debugger
Supports Compiler Configurations, Configuration Manager and Makefile Support (with a
Wizard).
It has a Classes Window, a Usages Window and a File Navigation Window (or panel).
A Macro expansion view, and also tooltips.
Support for QT development.
I think it's a perfect (and far better) Visual Studio substitution, and a very good tool to learn C/C++.
Good Luck!
At least for Qt specific projects, the Qt Creator (from Nokia/Trolltech/Digia) shows great promise.
could you clarify a little bit more how it was for you, what you had to change. Maybe you could point me in the right direction by providing some links to the information you used.
My first source were actually the tools' man pages. Just type
$ man toolname
on the command line ($ here is part of the prompt, not the input).
Depending on the platform, they're quite well-written and can also be found on the internet. In the case of make, I actually read the complete documentation which took a few hours. Actually, I don't think this is necessary or helpful in most cases but I had a few special requirements in my first assignments under Linux that required a sophisticated makefile. After writing the makefile I gave it to an experienced colleague who did some minor tweaks and corrections. After that, I pretty much knew make.
I used GVIM because I had some (but not much) prior experience there, I can't say anything at all about Emacs or alternatives. I find it really helps to read other peoples' .gvimrc config file. Many people put it on the web. Here's mine.
Don't try to master all binutils at once, there are too many functions. But get a general overview so you'll know where to search when needing something in the future. You should, however, know all the important parameters for g++ and ld (the GCC linker tool that's invoked automatically except when explicitly prevented).
Also I'm curious, do you have code completion and syntax highlighting when you code?
Syntax highlighting: yes, and a much better one than Visual Studio. Code completion: yes-ish. First, I have to admit that I didn't use C++ code completion even in Visual Studio because (compared to VB and C#) it wasn't good enough. I don't use it often now but nevertheless, GVIM has native code completion support for C++. Combined with the ctags library and a plug-in like taglist this is almost an IDE.
Actually, what got me started was an article by Armin Ronacher. Before reading the text, look at the screenshots at the end of it!
do you have to compile first before getting (syntax) errors?
Yes. But this is the same for Visual Studio, isn't it (I've never used Whole Tomato)? Of course, the syntax highlighting will show you non-matching brackets but that's about all.
and how do you debug (again think breakpoints etc)?
I use gdb which is a command-line tool. There's also a graphical frontend called DDD. gdb is a modern debugging tool and can do everything you can do in an IDE. The only thing that really annoys me is reading a stack trace because lines aren't indented or formatted so it's really hard to scan the information when you're using a lot of templates (which I do). But those also clutter the stack trace in IDEs.
Like I said, I had the 'pleasure' to set my first steps in the Java programming language using windows notepad and the command line java compiler in high school, and it was, .. wel a nightmare! certainly when I could compare it with other programming courses I had back then where we had decent IDE's
You shouldn't even try to compare a modern, full-feature editor like Emacs or GVIM to Notepad. Notepad is an embellished TextBox control, and this really makes all the difference. Additionally, working on the command line is a very different experience in Linux and Windows. The Windows cmd.exe is severely crippled. PowerShell is much better.
/EDIT: I should mention explicitly that GVIM has tabbed editing (as in tabbed browsing, not tabs-vs-spaces)! It took me ages to find them although they're not hidden at all. Just type :tabe instead of plain :e when opening a file or creating a new one, and GVIM will create a new tab. Switching between tabs can be done using the cursor or several different shortcuts (depending on the platform). The key gt (type g, then t in command mode) should work everywhere, and jumps to the next tab, or tab no. n if a number was given. Type :help gt to get more help.
Not to repeat an answer, but I think I can add a bit more.
Slickedit is an excellent IDE.
It supports large code-bases well without slowing down or spending all its time indexing. (This is a problem I had with eclipse's cdt). Slickedit's speed is probably the nicest thing about it, actually.
The code completion works well and there are a large amount of options for things like automatic formatting, beautification and refactoring.
It does have integrated debugging.
It has plug-in support and fairly active community creating them.
In theory, you should be able to integrate well with people doing the traditional makefile stuff, as it allows you to create a project directly from one, but that didn't work as smoothly as I would have liked when I tried it.
In addition to Linux, there are Mac and Windows versions of it, should you need them.
As an old-time UNIX guy, I always use Emacs. But that has a pretty steep and long learning curve, so I'm not sure I can recommend it to newcomers.
There really isn't a "good" IDE for Linux. Eclipse is not very good for C/C++ (CDT is improving, but is not very useful yet). The others are missing all the features you are going to be looking for.
It really is important to learn how all the individual tools (gcc, make, gdb, etc.) work. After you do so, you may find the Visual Studio way of doing things to be very limiting.
Checkout Netbeans, it's written in Java so you'll have the same environment regardless of your OS, and it supports a lot more than just C++.
I'm not going to try to convince you, because I think IDEs can be a very personal choice. For me it improves my productivity by being fast, supporting the languages I code in and has the standard features you'd expect from an IDE.
Just a quick follow up for this question...
It's been a month since I started using Vim as my main 'GUI'
tool for programming C++ in Linux. At first the learning
curve was indeed a bit steep but after a while and with the
right options turned on and scripts running I really
got the hang of it!
I love the way how you can shape Vim to suite your needs;
just add/change key mappings and Vim is turned into a
highly productive 'IDE'.
The toolchain to build and compile a C++ program on Linux is
also really intuitive. make and g++ are the tools you'll
use.
The debugger ddd is however not really that good, but
maybe that's because I haven't had the time to master it
properly.
So to anyone who is, or was looking for a good C++ IDE in
Linux, just like I was, your best bet lays with the standard
available tools in Linux itself (Vim, g++, ddd) and you
should really at least try to use them, before looking for
sonething else...
Last but not least, I really want to thank konrad for
his answer here, It really helped me find my way in the
Linux development environment, thank you!
I'm also not closing this question, so people can still
react or maybe even add new suggestions or additions to the
already really nice answers...
I recommend you read The Art Of UNIX Progranmming. It will frame your mind into using the environment as your IDE.
Shorter answer is: choosing whatever "editor" you like, then use GDB console or a simple GDB front end to debug your application. The debuggers come with fancy IDEs such as Netbeans sucks for C/C++. I use Netbeans as my editor, and Insight and GDB console as my debugger.
With insight, you have a nice GUI and the raw power of GDB.
As soon as you get used to GDB commands, you will start to love it since you can do things you will never be able to do using an GUI. You can use even use Python as your script language if you are using GDB 7 or newer version.
Most people here paid more attentions to the "Editors" of the IDEs. However, if you are developing a large project in C/C++, you could easily spend more than 70% of your time on the "debuggers". The debuggers of the fancy IDEs are at least 10 years behind Visual Studio. For instance, Netbenas has very similar interfaces with Visual Studio. But its debugger has a number of disadvantages compared to Visual Studio.
Very slow to display even a array with only a few hundreds of elements
No highlighting for changed value ( By default, visual studio shows changed values in the watch windows in red)
Very limited ability to show memory.
You cannot modify the source code then continue to run. If a bug takes a long time to hit, you would like to change the source and apply the changes live and continue to run your application.
You cannot change the "next statement" to run. In Visual Studio, you can use "Set Next Statement" to change how your application runs. Although this feature could crash your application if not used properly, but it will save you a lot of time. For instance, if you found the state of your application is not correct, but you do not know what caused the problems, you might want to rerun a certain region of the your source codes without restarting your application.
No built-in support for STL such as vector, list, deque and map etc.
No watch points. You need to have this feature, when you need to stop your application right at the point a variable is changed. Intel based computers have hardware watch points so that the watch points will not slow down your system. It might takes many hours to find some hard-to-find bugs without using watch points. "Visual Studio" calls "watch pointer" as "Data BreakPoint".
The list can be a lot longer.
I was so frustrated by the disadvantages of the Netbeans or other similar IDEs, so that I started to learn GDB itself. I found GDB itself are very powerful. GDB does not have all the "disadvantages" mentioned above. Actually, GDB is very powerful, it is even better than Visual Studio in many ways. Here I just show you a very simple example.
For instance, you have a array like:
struct IdAndValue
{
int ID;
int value;
};
IdAndValue IdAndValues[1000];
When your application stops, and you want to examine the data in IdAndValues. For instance, if you want to find the ordinals and values in the array for a particular "ID", you can create a script like the following:
define PrintVal
set $i=0
printf "ID = %d\n", $arg0
while $i<1000
if IdAndValues[$i].ID == $arg0
printf "ordinal = %d, value = %d\n", $i, IdAndValues[$i].vaue
set $i++
end
end
end
You can use all variables in your application in the current context, your own variables (in our example, it is $i), arguments passed (in our example, it is $arg0) and all GDB commands (built-in or user defined).
Use PrintVal 1 from GDB prompt to print out values for ID "1"
By the way, NetBeans does come with a GDB console, but by using the console, you could crash Netbeans. And I believe that is why the console is hidden by default in NetBeans
I am using "Geany" found good so far, its fast and light weight IDE.
Among Geany’s features are:
Code folding
Session saving
Basic IDE features such as syntax highlighting, tabs, automatic indentation and code completion
Simple project management
Build system
Color picker (surprisingly handy during web development)
Embedded terminal emulation
Call tips
Symbol lists
Auto-completion of common constructs (such as if, else, while, etc.)
If you like Eclipse for Java, I suggest Eclipse CDT.
Despite C/C++ support isn't so powerful as is for Java, it still offers most of the features. It has a nice feature named Managed Project that makes working with C/C++ projects easier if you don't have experience with Makefiles. But you can still use Makefiles.
I do C and Java coding and I'm really happy with CDT. I'm developing the firmware for a embedded device in C and a application in Java that talks to this device, and is really nice to use the same environment for both. I guess it probably makes me more productive.
I love how people completely miss the request in the original question for an IDE. Linux is NOT an IDE. That's just not what those words mean. I learned c and c++ using vi and gcc and make, and I'm not saying they aren't adequate tools, but they are NOT an IDE. Even if you use more elaborate tools like vim or emacs or whatever fancy editor you want, typing commands on a command line is not an IDE.
Also, you all know make exists as part of visual studio right? The idea that an IDE is "limiting" is just silly if you can use the IDE to speed some things, yet are still able to fall back on command line stuff when needed.
All that said, I'd suggest, as several above have, trying Code blocks. Its got decent code highlighting, a pretty effortless way to create a project, code it, run it, etc, that is the core of a real IDE, and seems fairly stable. Debugging sucks...I have never seen a decent interactive debugger in any linux/unix variant. gdb ain't it. If you're used to visual studio style debugging, you're pretty much out of luck.
Anyway, I'll go pack my things, I know the one-view-only linux crowd will shout this down and run me out of town in no time.
make + vim + gdb = one great IDE
I quite like Ultimate++'s IDE. It has some features that were designed to use with their own library (which, BTW, is quite a nice toolkit if you don't want to buy on either GTK+ or QT) but it works perfectly well with general C++ projects. It provides decent code completion, good syntax colouring, integrated debugging, and all other features most modern IDEs support.
I really suggest codeblocks. It's not as heavy as Eclipse and it's got Visual Studio project support.
Perhaps the Linux Tools Project for Eclipse could fill your needs?
The Linux Tools project aims to bring a full-featured C and C++ IDE to Linux developers. We build on the source editing and debugging features of the CDT and integrate popular native development tools such as the GNU Autotools, Valgrind, OProfile, RPM, SystemTap, GCov, GProf, LTTng, etc. Current projects include LTTng trace viewers and analyzers, an RPM .spec editor, Autotools build integration, a Valgrind heap usage analysis tool, and OProfile call profiling tools.
On Linux there are plenty of IDEs:
Code::blocks
Codelite
KDevelop
Qt Creator
Eclipse with CDT
NetBeans
In my experience, the most valuable are Eclipse and Qt Creator.
Both provide all "standard" features (i.e., autocompletion, syntax highlightning, debugger, git integration).
It is worth noting that Eclipse also provides refactoring functionalities, while Qt Creator provides integration with Valgrind and support for deployment on remote targets.
Also the commercial CLion IDE seems preety good (but I've not used it extensively).
I hear Anjuta is pretty slick for Gnome users. I played a bit with KDevelop and it's nice, but sort of lacking featurewise. Code::Blocks is also very promising, and I like that one best.
Sun Studio version 12 is a free download(FREE and paid support available) -- http://developers.sun.com/sunstudio/downloads/thankyou.jsp?submit=%A0FREE+Download%A0%BB%A0.
I'm sure you have code completion and debugging support including plugin support in this IDE.
Sun Studio is available for Linux as well as Solaris.
forums : http://developers.sun.com/sunstudio/community/forums/index.jsp.
Sun Studio Linux forums : http://forum.sun.com/forum.jspa?forumID=855
I'll be eager to hear your feedback on this tool.
BR,
~A
I've previously used Ultimate++ IDE and it's rather good.
And then I noticed that this simply isn't how you work there*, and I threw everything out, spent a few days reading manuals, set up my shell (bash), set up a GVIM environment, learned the GCC/binutils toolchain, make and gdb and lived happily ever after.
I'd mostly agree, but the problem is also one of perception: we forget how difficult it was to become productive in any chose IDE (or other environment). I find IDE's (Visual Studio, NetBeans, Eclipse) amazingly cumbersome in so many ways.
As an old-time UNIX guy, I always use Emacs. But that has a pretty steep
and long learning curve, so I'm not sure I can recommend it to newcomers.
I'd second that; use Emacs as my primary editor on both Linux and on MSW (XP2,W2K).
I would disagree that it has a steep learning curve, but would say that because of the huge number of features it has a long learning curve. You can be productive within a short time, but if you want you can learn new features of it for years to come.
However -- don't expect all the features of Emacs to be available on drop-down menus, there is just too much functionality to find it there.
As I metioned, I've used GNU Emacs on MSW for years. And it's always worked well with Visual Studio until I "upgraded" to 2008; now it sometimes delays many seconds before refreshing files from disk. The main reason for editing in the VS window is the "Intellisense" code completion feature.
geany I recommend
Although I use Vim, some of my co-workers use SlickEdit which looks pretty good. I'm not certain about integrated debugging because we wouldn't be able to do that on our particular project anyway.
SlickEdit does have good support for navigating large code bases, with cross referencing and tag jumping. Of course it has the basic stuff like syntax highlighting and code completion too.
I use Eclipse CDT and Qt Creator (for Qt applications).
That's my preferences. It's a very suggestive question and there is as many answers as there is developers. :)
SlickEdit. I have used and loved SlickEdit since 2005, both on Windows and on Linux. I also have experience working in Visual Studio (5, 6, 2003, 2005) and just with Emacs and command line. I use SlickEdit with external makefiles, some of my teammates use SlickEdit, others use Emacs/vi. I do not use the integrated debugger, integrated version control, integrated build system: I generally find too much integration to be real pain. SlickEdit is robust (very few bugs), fast and intuitive. It is like a German car, a driver's car.
The newest versions of SlickEdit seem to offer many features that do not interest me, I am a little worried that the product will become bloated and diluted in the future. For now (I use V13.0) it is great.
For me Ultimate++ seems to be the best solution to write cross-os program
If you were using vim for a long time, then you should actually make that as your IDE. There are a lot of addons available. I found several of those as pretty useful, and compiled it here, have a look at it.
C/C++ IDE
Source code browser
And a lot more in the vi / vim tips & tricks series over there.