Avatar of thready
thready
 asked on

step into shared library with Visual Studio 2008

Hi Experts,

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

Avatar of undefined
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

https://www.experts-exchange.com/questions/20262738/Debug-into-the-MFC-libs.html

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
thready

ASKER
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)...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
lhl60

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) ?
 
Your help has saved me hundreds of hours of internet surfing.
fblack61
thready

ASKER
Hi Peter,

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...

Mike

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
itsmeandnobodyelse

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
thready

ASKER
deleting all my debug folders and cleaning the heck outta the project worked.  Thanks Itsme