You are not logged in.
Hi, I have a C++ program which includes an external header. In this header a class is declared, and some inline members are implemented. When I run my executable it runs strange, in the sense that it seems not to execute the code as specified in the header, but rather behave as an old version of that header. So I was wondering: is it possible, from the binary file, to extract the names of the source files, including headers?
Thanks
Last edited by snack (2010-06-24 16:34:59)
Offline
I don't think the binary will contain that information (unless it has debug symbols). Usually headers are located in /usr/include, and you could check the makefile for the program to look for other locations/subdirectories
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
If you changed the header, you have to recompile any files that #included that header. It's also possible that g++ is finding an old version of the header somewhere, so use g++ -v to see what the header search path is.
Offline
Thanks, I actually found the problem. The header in question contains an inline method for a class. Then, in another library, I have a function which calls this inline method: the inline code is then compiled and put into this library. Then my main program calls the function from this library, so changing the code in the header without recompiling the library had no effect on my program. A real noob-error, indeed...
Thank you anyway, PirateJonno and tavianator!
Last edited by snack (2010-06-24 16:34:46)
Offline