When you are trying to debug a dynamic library in C or C++ in Netbeans it is frustrating not to be able to step into the code. Since I continue to forget how to set this up I have made some notes for future reference. Maybe other people will have the same problem.
- Build the dynamic library as a project in Netbeans
- Add it as a project in the project Properties->Build->Linker->Libraries dialog of the main application
- Set the library project to build Debug code
- Add the library's source folder in the main application to Project Properties->General->Source folders
- Add the library project to Properties->Related Projects of the main application project and check the "build" box. (optional)
Now rebuild the main project or just debug it and you should be able to step in to the library code.
I would just like to point out that, at least for me, you only need to go up to the 3rd step, but the others may be needed on non-linux OS's.
ReplyDeleteAnyway thanks a lot for the help, I never actually thought to set the linker to build debug code lol.