Using C++ IDE in linux is a pain in the neck

Leros

Lifer
Jul 11, 2004
21,867
7
81
(Let me preface this by saying that I'm a Java developer. I haven't done C++ since I was an undergraduate and I was using Visual Studio at the time which 'just worked'.)

I've been setting up a small C++ project under Ubuntu. It took me a few minutes to download the necessary libraries and build it from the command line. I wanted to use an IDE with completion and such, so I installed Netbeans. Netbeans pulled in a few things from the Makefile, but it still couldn't resolve a bunch of headers including standard library stuff (e.g. stdio.h).

I had to add the following includes and the one processor definition to make Netbeans happy:

Code:
// includes (some of these may not be needed, not quite sure)
/usr/local/lib
/usr/include
/usr/lib
/lib
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.6.3/include
/usr/include/c++/4.6.3
/usr/include/X11
/usr/include/GL
/usr/local/include/FL
/usr/include/c++/4.6/x86_64-linux-gnu
/usr/include/linux
/usr/include/x86_64-linux-gnu
/usr/include/x86_64-linux-gnu/asm
/usr/include/x86_64-linux-gnu/gnu
/usr/include/x86_64-linux-gnu/bits
/usr/include/x86_64-linux-gnu/sys

// preprocessor definitions
__x86_64__

Not knowing what I'm doing, this took me about 2 hours and was pretty frustrating. I feel like I must have done something wrong. I feel like this shouldn't have been a manual process. I just pulled in standard stuff and stuff that should have been pulled in from the Makefile (like GL and FL).
 
Last edited:

postmortemIA

Diamond Member
Jul 11, 2006
7,721
40
91
setting up project parsing is not trivial. you are not doing anything wrong. you'd have to do the same on netbeans on windows. some of these you've listed must be already under c/++ options, compiler include directories.

even visual studio has such configuration (windows sdk location), however it is automated.
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
Seems like the IDE should be able to get all the information it needs from the Makefile. The compiler is able to.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
vim supports auto-completion. While writing C++ in Linux I find it far easier to stick with the command line/Make system and a text editor than mess with an IDE.

What other things in an IDE are must haves for you?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
vim supports auto-completion. While writing C++ in Linux I find it far easier to stick with the command line/Make system and a text editor than mess with an IDE.

What other things in an IDE are must haves for you?

Integrated single step debugging is nice. Being able to click a variable and inspect its runtime value, or add it to a watch window. Being able to click a library reference and display all of its exported types in an object browser. Hitting F1 on an API reference and having the API help pop up in a browser window. Being able to open a query window and connect to a database server and issue queries or browse schema objects. Having an immediate window where you can evaluate any expression at runtime.

I don't mind working in Sublime Text for my python stuff. I just haven't found an IDE that I felt met the standard set by VS. But I don't think IDEs were a step backward. When the command line was all we had most developers welcomed IDEs.
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
I hear you Mark. I just spent awhile setting up an environment for node development against an Ubuntu VM from Windows with Sublime Text 2. Going ok for now but I'm dreading a bit of the debug experience I know I'll need in the near future. I've found some tools that may get the job done.

PyDev plugin for Eclipse has integrated Python debugging. At least it did a few years ago.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
I hear you Mark. I just spent awhile setting up an environment for node development against an Ubuntu VM from Windows with Sublime Text 2. Going ok for now but I'm dreading a bit of the debug experience I know I'll need in the near future. I've found some tools that may get the job done.

PyDev plugin for Eclipse has integrated Python debugging. At least it did a few years ago.

I was never able to get PyDev working with virtualenvwrapper to my satisfaction, but this was a few years ago. I should probably take another look. I just never could wrap my brain around Eclipse's notions of perspectives and workspaces. I've tried a few others, such as Aptana, and people have recommended PyCharm. For now ST2 works but I am not yet using 1/10 it's power and flexibility.

For debugging in python, I was initially worried about not having all the tools I'm used to right at hand. But the truth is I had forgotten a lot of what was nice about working with an interpreted language. It's so easy to run snippets in the shell, and tools like werkzeug actually will break out a shell in a web page on an exception and let you evaluate expressions in the current stack frame. It's enough to get by, and it's funny, but in some ways it forces me to be more in tune with the code and what it does. It's so easy in an IDE to get information that maybe we don't have to think about it as much.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,591
5
0
I have used KDE for projects under Linux when developing gaming systems. It was able to do the job nicely.
At the time I was supporting two projects; having to switch between Linux and Windows daily.
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
vim supports auto-completion. While writing C++ in Linux I find it far easier to stick with the command line/Make system and a text editor than mess with an IDE.

What other things in an IDE are must haves for you?

I like having a graphical IDE to explore a large project. I also like having a graphical debugger. I like intelligent auto complete.

It's what I'm used to. I spend all day in IntelliJ doing Java development. No reason to learn the "unix as an IDE" method for a small C++ project.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
I like having a graphical IDE to explore a large project. I also like having a graphical debugger. I like intelligent auto complete.

It's what I'm used to. I spend all day in IntelliJ doing Java development. No reason to learn the "unix as an IDE" method for a small C++ project.

I understand the reasoning, but from a practical standpoint I still find using the tools directly from the CLI to be far more productive than trying to use a semi-broken IDE in Linux, at least with the projects I work on.

If there was the Visual Studio equivalent(in quality and features) for Linux I would probably use that.

Everything you guys have mentioned as 'features' are all things you can do with other 3rd party tools and some additional plugins to vim.

I've thought a graphical debugger would be nice, but the amount of time I actually spend in a debugger vs writing unit tests is rather lopsided. Stepping into the debugger is usually a last resort for me so using gdb really isn't an issue.

It took me a few weeks to get used to this, but now I'm far more productive than when I was trying to use Eclipse or some other IDE for C++ work.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
I've thought a graphical debugger would be nice, but the amount of time I actually spend in a debugger vs writing unit tests is rather lopsided. Stepping into the debugger is usually a last resort for me so using gdb really isn't an issue.

It took me a few weeks to get used to this, but now I'm far more productive than when I was trying to use Eclipse or some other IDE for C++ work.

The times when I need to step through code are pretty infrequent and, yes, unit testing does help eliminate a lot of runtime issues that otherwise might require forensic tools to diagnose. But when you do get one, it doesn't matter how infrequent they are . I am fine with pdb and print statements to find issues in my python code, but I don't feel like I am "way more productive" doing it that way. It would be nice to at least have the basic features that Borland included in Turbo Debugger in 1989.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
The times when I need to step through code are pretty infrequent and, yes, unit testing does help eliminate a lot of runtime issues that otherwise might require forensic tools to diagnose. But when you do get one, it doesn't matter how infrequent they are . I am fine with pdb and print statements to find issues in my python code, but I don't feel like I am "way more productive" doing it that way. It would be nice to at least have the basic features that Borland included in Turbo Debugger in 1989.

Like what? With GDB you can set watchpoints and breakpoints(conditional ones at that too) amongst various other debugger features.

I know there is a front to GDB as well, but I've never used it. I could see that being useful if you need to setup more than a handful of watchpoints or breakpoints.. but certainly not a requirement.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
Like what? With GDB you can set watchpoints and breakpoints(conditional ones at that too) amongst various other debugger features.

I know there is a front to GDB as well, but I've never used it. I could see that being useful if you need to setup more than a handful of watchpoints or breakpoints.. but certainly not a requirement.

Mostly, the ability to have it all laid out dashboard style. Yeah, I can query the value of any global or local variable, set breakpoints, and all that. But it's nice to be able to open a watch on an object of interest and just glance down and see what it's value is as the code executes, or to easily drill down into the properties of an object and follow those references wherever they lead.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
With VC++ it's nice to be able to single-step through code, viewing the source, having the local variables display automatically with color-coding to highlight value changes. Being able to mouse over variables in the source and getting values as tooltips is nice too.

Visual Studio offered that in 1999.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
With VC++ it's nice to be able to single-step through code, viewing the source, having the local variables display automatically with color-coding to highlight value changes. Being able to mouse over variables in the source and getting values as tooltips is nice too.

Visual Studio offered that in 1999.

Nobody is really disputing the fact that Visual Studio is king IDE.

We're mostly debating CLI vs GUI here. So far all I have gotten out of it is that people like to use their mouse to point and click at things.

I personally find the tools available on the Linux command line to be just as powerful and usable as all the other graphical IDEs available on Linux when writing C++. I have never found myself saying 'damn, wish I had a graphical IDE for this' while writing C++ on Linux.

On the other hand, getting all of those same tools to work seamlessly in a windows environment is not a trivial task, so the obvious choice when programming in Windows is Visual Studio.

If Visual Studio ran on Linux natively and worked just like it does on Windows I might consider using it.
 

Cogman

Lifer
Sep 19, 2000
10,278
126
106
For a C++ project, I would suggest CMAKE. It works (semi-ok) with most IDEs and is a decent build system. It isn't anywhere near as bad to setup as the old autoconf tools and it is much more friendly to a windows environment.
 

Leros

Lifer
Jul 11, 2004
21,867
7
81
Interesting. I just setup the same project on my laptop. I created a new project in Netbeans, added the source code, and everything just worked.

Same version of Netbeans.
Same code.
Same OS (Ubuntu 12.04)

Only difference is that this laptop is 32-bit while my desktop is 64-bit.
 

JasonCoder

Golden Member
Feb 23, 2005
1,893
1
81
Bro, have you considered making a soup to nuts screencast on developing/debuging from the CLI (under any OS)? I'd pay for that kind of content at Pluralsight, peepcode, tekpub, etc.

Nobody is really disputing the fact that Visual Studio is king IDE.

We're mostly debating CLI vs GUI here. So far all I have gotten out of it is that people like to use their mouse to point and click at things.

I personally find the tools available on the Linux command line to be just as powerful and usable as all the other graphical IDEs available on Linux when writing C++. I have never found myself saying 'damn, wish I had a graphical IDE for this' while writing C++ on Linux.

On the other hand, getting all of those same tools to work seamlessly in a windows environment is not a trivial task, so the obvious choice when programming in Windows is Visual Studio.

If Visual Studio ran on Linux natively and worked just like it does on Windows I might consider using it.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I've been using Eclipse with Pydev for my Python work on Ubuntu. That and vrapper (VIM plugin since I'm OK at VI) and it's really nice. Just download and install it in your home folder so you can get the latest version and have no permissions issues.
I'd probably check into Eclipse and use it for everything on Linux.

Otherwise, I keep Geany in my back pocket.
I work on Windows, Ubuntu and OSX currently so I've tried to move to tools that work on all 3. If you were on Windows only, VS shell is probably tough to beat.

If you haven't tried Eclipse lately, I'd recommend it. I haven't had any problems, and the plugins are now installed via URLs. You basically do nothing, put http://vrapper.sourceforge.net/update-site/stable/ in your plugins and it pulls down the latest version with no issue.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
I see VIM and Eclipse as investments. VI skills are pretty useful and Eclipse can be used for everything. I really haven't had a problem with 'heavy' programs for years, since SSDs and grossly overpowered CPUs came to be the norm.

Maybe Geany or ST3 is what you're looking for. I really like gedit on Linux. The simplicity is really refreshing, yet its got a lot plugins.
 
Last edited:
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |