Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dependency - Knows what dll to find, but cant locate it!

Status
Not open for further replies.

BigOrangeMonkey

Programmer
Aug 27, 2002
26
0
0
GB
Hi,

I've been thrown into correcting a Visual C++ DLL (Usually program UnifAce and VB), I have got the DLL I'm building to compile but it doesnt run. When I check the DLL using the Dependency Viewer its saying it cant locate two of the dlls (yrtlc.dll and urtlc.dll).

How do I tell the system where to look for these DLLs?

Thanks very much, all help is greatly appreciated.
Steve.

Oh, Im using VC++ 6
 
>> paths have been set to point at them correctly before
>> compilation.

The paths are compiled into the code? That's just not right.

Do you dynamically load the DLL's using LoadLibrary()? Does it return NULL? If so what is the error returned from GetLastError()?

-pete
 
Include/Library paths in tools/options have been set to point to the correct locations on the file system. These are set before attempting to compile the code.

(I have not hard coded any paths)

If I set system path to point to this location then the dependency walker finds the dlls (Without having to recompile). Is there a way I can get the paths into my compiled dll so the system path doesnt have to get set on every site?
 
>> Is there a way I can get the paths into my compiled dll >> so the system path doesnt have to get set on every site?

If you use LoadLibrary you can supply the path, but how does that solve your problem? How do you know where the files are on different machines? That is what the path is used for and installation programs typically handle those sorts of issues since they know where the file was installed yes?

-pete
 
It is a straight recompile of another developers software, he left some time ago, his dll dependencies are fine, but mine are only ok when I alter the system path.

Im new to this so please forgive my lack of knowledge, I have umpteen books on this but am struggling to find an answer.

Thanks,
Steve.
 
>> please forgive my lack of knowledge

That is not a problem. The fact that we don't know where your knowledge boundaries are is why it's difficult to give you the information you need. ;-)

>> his dll dependencies are fine

Does that code use LoadLibrary supplying a path that is determined at runtime? If so how is the path being determined? Perhaps posting the code would help.

If not using LoadLibrary then the path is being used. How does this application and the dll’s get installed?

-pete
 
Before the guy who wrote this left he put all the code onto source safe, I have sinced pulled the code onto my machine and compiled it.

The dlls are not being called directly by code, they are included as libs which link to dlls upon compilation.
They must be included for UnifAce to successfully link with external DLLs, they contain no code, they only exist to tell the linker which service funtions should be resolved at load time.

They are :
urtl.lib --> urtlc.dll
yrtl.lib --> yrtlc.dll

The original dll is on my pc and works.
The dll I compile only works if I mess with my system path!

As for my knowledge level, until 3 days ago I hadnt touched on any C!
 
Did you pull the project file from source safe as well?

-pete
 
Hi palbano,

Yes everything was pulled from sourcesafe (Except the Workspace .dsw)

All I've done to the dsw is add additional Include directories to make it compile.

Cheers,
Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top