Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@sources.redhat.com Delivered-To: mailing list cygwin@sources.redhat.com Date: Mon, 28 May 2001 17:17:03 +0200 (EEST) From: Mariusz Woloszyn X-Sender: woloszyn@dzyngiel.ipartners.pl To: cygwin@cygwin.com Subject: external symbols within dll Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-2 Content-Transfer-Encoding: 8BIT Is it possible under cygwin to refer to global symbols declared in main program from a dll??? I DO NOT want to export symblos from dll to executable. Consider following (under unix): [woloszyn@dzyngiel]$ cat foo.c extern int c; foo () { printf("Fooo!\n"); printf("c=%i\n",c); } [woloszyn@dzyngiel]$ gcc -shared foo.c -o foo.so [woloszyn@dzyngiel]$ And I have foo.so with unresolved symbol c, which is OK for me! If I try to compile identical code under cygwin I get: > gcc -c foo.c > dllwrap -o foo.dll foo.o dllwrap: no export definition file provided dllwrap: creating one, but that may not be what you want foo.o(.text+0x2a):foo.c: undefined reference to `c' foo.o(.text+0x3e):foo.c: undefined reference to `c' collect2: ld returned 1 exit status dllwrap: gcc exited with status 1 > I want my foo.dll library to be able to access global program functions and symbols but not if executable is linked against it (with -lfoo -L.) but after dlopen(). I'm able to do it under unix. Is it possible to build such library??? (I played with __declspec(dllimport/dllexport) stuff, but it does nothing to me as long as I have to link my executable against such shared lib (I have more than one .dll with foo() functions :). Regards, -- Mariusz Wołoszyn Internet Security Specialist, Internet Partners -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple