Dependency walker

L

Larry Waibel

I'm having a problem with my program not running on the target and I'm pretty
sure it's because it's missing a system DLL. But when I try to load it under
'depends.exe' on the target, nothing happens. I have the depends.exe and
it's DLL. Any idea what other things it needs to run that I might not have
on the target? Thanks!
 
K

KM

Larry,

What do you mean by "nothing happens"? Does the Dependency Walker show you
the binary dependencies of the app?

In any case you can launch the depends.exe on a development machine and
check what binaries are required to be in your image.

Regards,
KM
 
L

Larry Waibel

By nothing happens I mean that I try to load the executable, nothing happens,
no monitoring of it and dependency walker doesn't show anything; acts like it
didn't even load. My application on the target just says the system can't
execute it when I try to run it. In the past this has been because of some
missing DLL. If I run depends on the development machine it loads all the
DLLs from the development system so it's difficult to tell which is missing
on the target. I was hoping it would show me that. I've compared all the
DLLs it loads on the development system and copied the ones I found missing
over to the target but it still won't run. I had been building the target
program using VS 6.0 C++ and that works but am now trying to build it with VS
2008 (still just C++ and MFC) and get it to run on the target. I've copied
over the MSVCxx90xx.DLL files but it still won't run.
 
K

KM

Larry,

You can load the depends.exe in DependecyWalker app (itself) to see waht
DLLs are required to have it running on the target. You better do that on
the dev machine.

In Dependency Walker, when launched on your dev machine, you can
chnage/specify the Module Search Order (menu Options-->Configure Module
Search Order), remove all system paths there but add your image build
directories (with \windows and \system32 subpaths). Then you will be able to
see the missing DLLs.

Also, you can always manually check all the DLLs that are supposed to be in
your image. But you better off addomg appropriate components that hold those
DLLs than just copying the DLLs. Some Dlls may require registration, etc.

And last but not least. The sysinternals's FileMon tool can be used instead
of the DependencyWalker to find out missing files.

Regards,
KM
 
L

Larry Waibel

I can't see how to 'remove' places that are being searched on the development
machine? There's a way to move them up or down but not delete them.
 
K

KM

Larry,

You probably want to use the arrow buttons (<<, >>) located in the middle of
that dialog. This is how you can remove particualr search groups from the
Current Search Order.
 
L

Larry Waibel

Okay, I figured out that I had to create an empty .dwp file and then add the
directories I want to search. I can load the application on the dev machine but
when I try to run on the target it says "The system cannot execute the specified
program." I loaded each up in depends and copied all the missing and different
DLLs from the dev system to the target but it still won't run on the target.
What else could be wrong that would give me that message?
 
K

KM

Well, there was a bit easier way to remove unnecessary search paths but doesn't matter since you got the result.

Are you only copying the Dlls but not registering them? (COM object would need to be registered and etc.)
This may not be important since it seems to fail on loading the executable as you indicated earlier.

Any way for you to launch the app on the target with the FileMon running in background and monitoring the file activities? You may
be able to see what Dll or other dep it is failing to load.

Also, did you make sure you properly set up the app manifest (since you are now building with VS 2008). Make sure the Dlls there are
either listed with the right paths or located in the system dir.
 
K

KM

Larry,

The FileMon log you posted showed that you are missing the Microsoft.VC90.CRT.DLL library. Obviously, you don't have that library
added properly to the image .Net GAC's folder.
Did you copy the library to the app folder c:\sra at least (doesn't seem so from the FileMon log)?
The manifest for the app (sra.exe.Manifest) was built by the VS. You should be able to find it in your VS project's build folder.
When you look into the file you will notice all the static dependencies mentioned there. You can edit the paths to the dep dlls if
you need to.
 
K

KM

Larry,

Guessing here but seems like you are facing an issue similar to the one mentioned here:
http://km-dev.blogspot.com/2007/04/xpe-tip-26-msvcr80-in-xpe-world.html

You difference is that you use VS2008, right? Therefore the CRT libraries are different (vc90 vs vc80).
You can try the suggestions on how to fix the error mentioned in the article. If possible, get rid of the multi-threaded switches in
the app project build (at least for experimenting purposes).

Are you sure VC90 libraries are NOT on your dev machine? If you have VS2008 installed they must be there (under MS VS install
folders). It is just that your GAC is set up the way that it knows where to search for the dlls. But it is not set up the same way
on your XPe system. The app manifest, that you can find on the build machine, should tell you what assemblies the app depends upon.
 
K

KM

Larry,
I've used XP's 'search' and don't find that file; don't know if it would
see it
in the GAC or not. There is a folder named Microsoft.VC90.CRT that's part
of the
'redist' but it contains files like 'msvcp90.dll' which was identifed by
'depends'.

That is what you needed. Take a look at the Microsoft.VC90.CRT.manifest
file. It points to the msvcp90.dll.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top