delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/11/22/08:39:12

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3FBF66F3.FF68C5C5@dessent.net>
Date: Sat, 22 Nov 2003 05:38:59 -0800
From: Brian Dessent <brian AT dessent DOT net>
Organization: My own little world...
X-Accept-Language: en,en-US
MIME-Version: 1.0
To: Cygwin Mailing List <cygwin AT cygwin DOT com>
Subject: Re: linking 3rd party DLLs to my code.
References: <Pine DOT WNT DOT 4 DOT 58 DOT 0311220105410 DOT 448 AT euclid>
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - host.linuxsv3.net
X-AntiAbuse: Original Domain - cygwin.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - dessent.net
Note-from-DJ: This may be spam

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

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019