Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I recently obtained a contract where I will be doing scientific software development with g++ on Unix platform after many years doing Visual C++ development in Windows. The code itself will be algorithmically and mathematically dense.

I am interested in recommendations for books, resources, tools, etc. Are there any specific books or websites devoted to VC++ devs moving to g++?

Also, the company has more or less standardized on Eclipse. However, the final choice is up to me. One of my interviewers complained about Eclipse's performance in C++ and he uses other tools. My own experience attempting to use Eclipse with g++ has been less than invigorating. Is there a Visual Studio-like IDE for g++?

share|improve this question
1  
Try codeblocks, but either way, Linux IDEs are light years behind... After more than a year of working with Linux, I sat back to VS2010, an instantly felt the difference. It's like night and day. – Coder Jul 15 '12 at 17:45

5 Answers

up vote 7 down vote accepted

One of the primary advantages of Windows is Visual Studio. G++ is, from a technical perspective, probably the superior compiler- it has, for example, better C++11 support. However, Unix has nothing close to VS in terms of ease of use- especially the Visual C++ debugger, which is miles ahead of GDB. Unix C++ development is full of obscure command-line tools and switches and an infinity of make/configure files.

In addition, the PPL is quite a long way ahead of any free alternatives- you can purchase TBB, though.

Also, do not forget that G++ has some types which are different to VS- for example, they use UTF-8 const char* strings, rather than UTF-16 const wchar_t* strings, and for x64 then int is 64bit as well as long.

share|improve this answer
ddd was nice for visualising complex or scientific data while debugging - but it doesn't seem to have been updated for years. Is there a replacement? – Martin Beckett Jul 15 '12 at 17:05
What's DDD? Never used it. – DeadMG Jul 15 '12 at 17:20
2  
I don't but that VS studio is a superior development environment. It is easy to learn in the short term than the unix equivalents. But once you learn the UNIX versions in my opinion a much more productive environment. The difference is that it takes you a couple of years of learning the tools to get as productive as you would be in VS in a week. But once you break that barrier it becomes significantly more productive. – Loki Astari Jul 15 '12 at 17:47
1  
@LokiAstari: That's why I'm saying WinDbg is for complex stuff. It's fully scriptable, extendable, and doesn't laggg like GDB. – Coder Jul 15 '12 at 18:00
1  
@K.Steff: So is Visual Studio. And, for 1), then a mere 90% or was it 95%? of desktops are Windows, so meh, really. – DeadMG Jul 16 '12 at 1:05
show 5 more comments

Three years ago I faced the same situation. I took the approach of writing and debugging most of my platform non-specific code in VS C++, because I like the IDE and the rich debugging environment. At the same time, I used Eclipse CDT to maintain my makefiles and build scripts on Linux.

If your project is not heavily GUI oriented (sounds like it's not), then most, if not all, can be cross platform. I ended up structuring my code in several static libraries, and they are unit tested on both Windows and Linux. Only about 5% of the code needed to be #ifdef for specific platform implementation (e.g. threads and interprocess messaging).

That said, I don't find Eclipse CDT being particularly slow. It works well enough even when running my Linux environment as a guest OS on my (pretty beefy) Windows laptop.

For writing cross-platform C++ code, you may want to look at the Boost C++ libraries.

share|improve this answer

The posts around this one contain some excellent suggestions. I have a couple that weren't mentioned, but, I think, will help you a bit. You'll run your software on Linux, but there's nothing to prevent you from developing on other platform. You can use Visual Studio to write and debug your C++ code and then build it with g++. Another option is to do it on a Mac with Xcode. I have used it a bit and I kind of like it. Another option is NetBeans, which, I think, feels lighter than Eclipse.

If you are used to Visual C++, I don't think you'll enjoy Emacs or Vim. They are an acquired taste and involve a lot of relearning for developers coming from the Windows side of the fence.

Having said that, welcome and enjoy your stay. I hope you like the way we develop software here.

share|improve this answer
+1 for this, in my experience the best solution. Also the workflow can be quick, 2 examples: run VS inside a VM on the main linux os, put code on a samba share so you can access/compile it from both machines. Or, use a windows machine as usual, put code on a share, login to some linux machine with ssh and compile as such. – stijn Jul 16 '12 at 9:50

The main ide on Linux os probably Eclipse or, and especially if you are using Qt anyway QtCreator (although you can use it to develop non-Qt code)

As DeadMG says, none of them are as nice as VS2010 however good the g++ compiler. For debugging I had used ddd front end to gdb, it has a lot of features that even VS doesn't have for displaying complex data structures (like images or matrices) in memory while debugging - but it doesn't seem to have been updated for a few years.

Finally one solution if you are developing purely maths orientated (rather than system/gui) code is to simply develop on Windows using VS and rebuild/test on Linux. You can use something like qmake to create cross-platform builds or simply manually keep an equivalent makefile

share|improve this answer
Virtual box, VS2010 express and cross compile. Your code will be cleaner because of that. Each compiler outputs different warnings, and each fails on different bugs faster. – Coder Jul 15 '12 at 17:48
I disagree. The main IDE on unix is probably still emacs followed by vim followed by Eclipse. – Loki Astari Jul 15 '12 at 18:03
@LokiAstari - yes the main ide is no ide! But if you wanted something like vs on Linux it's probably eclipse – Martin Beckett Jul 15 '12 at 18:05
If you don't think emacs is an IDE then you have not used it correctly. Personally I find it over-complex (its basically it own OS dedicated to development) to use but it is still an IDE. But yes if all you want is visual environemnt for developing simple applications Eclipse is fine and your best bet. I would agree that vim is not quite an IDE, but with the correct plugins its close enough. – Loki Astari Jul 15 '12 at 18:07
2  
emacs+make+gdb is perfectly capable, but the poster asked if there was anything like VS on linux. If they had asked "is there anything like Excel on Linux" a useful answer is "Yes open/libre office" a non-useful answer is "office calc is fine for simple calcs but you should use fortran+NAG" – Martin Beckett Jul 15 '12 at 18:13

If you really need a C++ IDE CodeBlocks is a great solution:

http://www.codeblocks.org/downloads/26

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.