views:

275

answers:

2

I have a dll project in a solution that I want to debug. The calling application is in a different path and the DLL must be placed inside that path. When I build the debug version and copy+paste the produced DLL into the calling application's path, I get an error message that there are no symbols and that the binary wasn't built by the project. It asks me if I want to continue. This method used to work in visual c++ 6.0 but now it never hits any breakpoints.. How do I do this in VS2005?

Thanks.

+1  A: 

Also copy <your dll>.PDB

abatishchev
Thanks, will try this out tomorrow.. :)
krebstar
+4  A: 

Make sure the pdb file for the dll is also in the application's path.

Or alternatively compile your dll with the /Z7 compiler option, that will trigger the old-style debug info as it was used in MSVC 6.0. If you compile like this, you will be able to copy just the dll.

Or alternatively in the 'Modules' window, right-click your dll and select 'Load Symbols', then point the dialog to the original location of your dll.

eli
Thanks, very detailed and helpful :)
krebstar
Btw, are there any disadvantages to using the /Z7 option? Does this include the symbols in the DLL therefore making the DLL larger and less secure? Would it be better to just point to the DLL in the Modules window and select Load Symbols? Thanks
krebstar
The symbols are indeed put in the DLL, making at larger.I think the easiest solution is to simply copy both the dll and the pdb files.
eli
Thanks eli :)! Will accept this answer tomorrow if it works :)
krebstar
It worked, but still complains about other DLLs being loaded that dont have debug info.. :) Thanks..
krebstar