This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linking 3rd party DLLs to my code.

Suresh Venkatasubramanian wrote:

> However I am able to link it. putting cg.dll in /usr/local/lib (say) and
> compiling with
> gcc -mno-cygwin <files> -L/usr/local/lib -lcg
> compiles with no complaints.
> However, cygcheck complains, saying that it cannot find the dll.
> When I place the dll physically in the dir that I am running from however,
> the code runs fine. (soft linking doesn't work; the dll has to be
> physically placed there).
> What might be the problem with what I am doing ? I suspect that I am doing
> something wrong to begin with and the fact that I can even link the DLL is
> an accident, rather than the other way around. Any help would be greatly
> appreciated.

Unless I'm really missing something, isn't this just a path issue? 
AFAIK, every DLL that your program links against must be either in the
path or in the same directory as the .exe (unless the program
specifically looks for it with dlopen() or whatever.)

If you add /usr/local/lib to your path, or move your dll into a
directory already in the path does that cause it to work as you expect? 
I'm not sure why a symlink in the current directory doesn't work but I
suspect it might be that it's Windows that's actually doing the loading
of the exe and its dlls, and Windows does not treat shortcuts as


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]