I've got a shared library that I link to just fine with my application, but I'd like to step into some functions and cannot. How do I get it to work?
Thanks a lot,
Mike
Microsoft DevelopmentVisual C++.NETSystem Programming
Last Comment
thready
8/22/2022 - Mon
peter41
To step in C/C++ code with debugger you must have debug version of your dll, else you can step only assembler instructions (in assembly window) in dll fucntions.
thready
ASKER
.... but shared libraries don't create a dll.....
lhl60
The is no difference between a dll and a static library, it's only a question of where the executable code is located (in your executable or in a system directory)
In either case you will need a debug version of the library in question, and access to the source code.
I you want to step into MFC code take a look at this thread
Weird, my .lib file that I'm linking to (my own library) is the debug version. This should work then right? I've also added "additional include directories" to point to the source so I can include them properly in my other project. Am I missing something else?
lhl60
try to set "working directory" in the debug options to where your lib source is located
thready
ASKER
What if I've got multiple lib sources in different folders? (which I do)...
hmmm....
Try the PATH variable
Does the "Working dir" work ?
thready
ASKER
I can't find the option for the PATH variable in the environment. Do you mean the windows path variable (outside of visual studio?)... That wouldn't be the right answer for me - even if it worked.
Also, the "working dir" can't work since it can only specify 1 directory - and that's not what the working dir is for anyway.... I appreciate you trying.
Thanks,
Mike
peter41
Are you sure that you link against debug version of your *.lib and not against release version ? Check please pathes in linker options of your exe file which links your *.lib.
In debug versions of result binaries are stored pathes to c/c++ source files,
and debugger finds source files by these pathes automatically.
If it does not find some source, it displays prompt for correct path to source file.
Do you try to debug on the same machine like you build *.lib ?
Are you sure that in your debug version is set debug info in compiler and linker options ?
(It is set by default, by it can be switched off by user)
Does display debugger some error when you try step into library function ? (menu Debug->Step Into (F11) ?
It is my debug version that I'm using. I haven't even built the release version. I am debugging on the same machine that I'm building the lib file on. There is no prompt for the path to my source files when pressing F11 to step into the desired function. The debug does in fact generate debug info for edit and continue....
Thanks,
Mike
peter41
Should be possible to sent me both projects (exe and lib) to my email pet3243@gmail.com ?
(If possible)
thready
ASKER
Hi Peter,
Thank you for your generous offer but the code is protected and it's not mine...