views:

279

answers:

2

I'm just starting out on a cross-platform (Windows, Linux, OS X) C++ project, and we've decided to use Scons for our build system and Eclipse as our IDE. I've figured out how to trigger Scons to do a Visual C++ build from Eclipse, and for errors etc. to get reflected in Eclipse, so all good so far. However, what would be really nice is if we could use Eclipse for debugging as well, but Eclipse's various gdb debugging options can't read the debug symbols that VC puts into the build. So does anyone know a way round this, or (as I suspect) will I have to use Visual Studio for debugging?

Obviously this is by no means a bad solution, but using a single IDE would be even better!

Thanks in advance for any help....

+2  A: 

Visual C++ creates PDB files for its own symbols that map into the binary. The only provision for other debuggers is to C7 format and hope that is enough for gdb.

Go to Properties | C/C++ | General | Debug Information = C7 Compatible (instead of the default PDB). Command line is /Z7 instead of other /Z? (which can be PDB or PDB with continue).

AlexC
This looks like what I'm looking for - thanks! The only remaining question is how to get gdb to pick up the symbols from the .obj file but to run the .exe. Older VC linker had a /PDB:NONE option that rolled the symbols into the .exe, but this isn't supported in VC 9. But I'm sure I'll figure it out - thanks again.
A: 

Would you not be better building you app with gcc for all the platforms? Then you can debug and compile on all of them easily and the hopefully the same way.

Preet Sangha
We did look at this option, but as Windows is our main platform we felt that we should use VC for Windows