views:

16

answers:

1

Hello,

I'm trying to debug a static library using MFC in Visual Studio 2008. When running the project in debug mode the breakpoints turn into circles and hovering over them produces the message "The breakpoint will not currently be hit. No symbols have been loaded for this document"

The project configuration is set to "Debug", and I have tried cleaning and rebuilding the solution, but this did not solve the problem.

In the project's debug folder, there is a vc90.pdb file, which is the file containing the debug information. When running project in debug mode I tried debug->windows->modules, right clicked on the exe file that was using the lib, and added the vc90.pdb file to the symbol settings. This still didn't work.

Has anyone had this problem, and any ideas of how to fix this?

Thanks, Alex

A: 

Alex - I just compiled a sample DLL/Exe from MSFT - DLLScreenCap. Worked fine, I was able to step into the DLL code ok. You should also be able to set a breakpoint in the DLL source, and it should hit that when called from the .exe. Does that work?

When I've had this kind of problem in the past - it usually turned out the IDE was loading an old version of the DLL, so I would test that by making some changing some feature in the DLL, and be certain that change shows up when you run the code. Just reality check to be sure the right code was getting loaded.

Jeff
Hey, thanks for your help. The problem was that the IDE was loading an old version of the DLL, and I wasn't recompiling the exe to use the new version. I didn't understand that static libs are merged with the exe code, so every time you update the static lib, you must recompile the exe.
Alex
Cool - I think you *might* be able to fix that, if you have the exe and dll in the same sources - look for "Build Dependencies" or something like that. You can make the .exe depend on the .dll, so if the dll rebuilds, the .exe will automatically rebuild. P.S. You can select "Accept this answer" so Stackoverflow will mark it as complete.
Jeff