sanctus Posted July 29, 2007 Report Posted July 29, 2007 The program I'm using uses a makefile to compile (not written by me no idea of how to do this...), now I changed the program a bit around and get a segmentation fault. For this reason I would like to use gdb for debugging, but to have its full functionality (for example line numbers) I would need to compile with g++ with the option -g. Is this right? So far it seems anyway the fault occurs in the gsl-files so backtrace won't bring much even if I have line numbers, because for it is not the gsl files having a bug, but mine... I just thought having all the symbol tables would give a bit more chances to find the bug... EDIT: in case the Makefile can be found in the cmbeasy code downloadable from CMBEASY Quote
alexander Posted July 31, 2007 Report Posted July 31, 2007 First try the g++ -ggdb infile -o outfileThen if there is an error in linking try a -lm option at the end of the line.And you dont ignore warnings if you get them, use a -Wall option to see all the warnings that come up during your compile, and try really hard to fix them. and then finally if none of that fixes the issue, try to iterate through your program with gdb, hopefully it will narrow down where the mistake is... Quote
sanctus Posted August 1, 2007 Author Report Posted August 1, 2007 Yesterday I went to see one of my profs and that is actually what we did somewhere in the makefile there were some FLAGS defined conaining already -Wall etc and we just added -ggdb. Thanks very much anyway. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.