0
votes

I'm trying to compile 3 projects:

  • A static library (.lib)
  • A dynamic library (.dll) that uses the .lib of the static library.
  • An application (.exe) that uses the .dll of the dynamic libaray

However, when trying to compile the .exe and setting a breakpoint, I get the warning "The breakpoint will not currently be hit. No symbols have been loaded for this document."
Well, I know that Visual Studio is missing the .pdb files somehow. However, I don't get why Visual Studio doesn't find it.

  • The .pdb file of the static library is being generated and is in the same folder than the .lib.
  • The dynamic library references the folder where the .lib and the .pdb of the static library are inside. A .pdb file is created in the same folder where the .dll is created for the dynamic libary.
  • The application copies the .dll and the .pdb of the dynamic library before compiling to the folder where the .exe is generated.

Still, Visual Studio is complaining that it doesn't have loaded any symbols. In the output console, it also tells me that it has loaded the symbols of the .exe and the .dll, but not of the .lib. Am I missing somewhat?

2
Why is the title tagged as C++ then tag the question as C?Ed Heal
It is a C++ project.user3067395
Shouldn't the question apply to both C and C++?user3067395
Did you compile and link with DEBUG enabled?user3344003
I switched to "Debug" in the Solution Configuration of Visual Studio, so it should be enabled. It also generated the .pdb files.user3067395

2 Answers

0
votes

When you compile the .exe, you should still link to the .lib file that has been generated when compiling the .dll (so I am speaking about the .lib that comes with the dynamic library, not the one that comes with the static one).

Depending on your visual studio version you might configure that here: Project->Properties->Configuration Properties->Linker>Input->Additional Dependencies

0
votes

What version of Visual Studio? Are all the projects in the same solution? If so, Just add the library as a reference to the DLL, and the DLL as a reference to the EXE. Then Visual Studio handles linking everything up, and the .exe, .dll, and .pdb files should all be in the solution output directory.

Also, if you use LoadLibrary to load the DLL the debugger won't load the debug info and won't know where to set the breakpoints in the DLL until after it is loaded, which can cause the error you are seeing as well.