delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/08/24/08:45:21

From: geier AT forwiss DOT uni-passau DOT de (Roland Geier)
Subject: Re: DLL Problem
24 Aug 1997 08:45:21 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199708212048.WAA07599.cygnus.gnu-win32@bombadill.forwiss.uni-passau.de>
Mime-Version: 1.0
In-Reply-To: <199708201219.OAA01103@hugo.int-evry.fr> from Stephane Mariel at "Aug 20, 97 02:19:29 pm"
Original-To: stf AT hugo DOT int-evry DOT fr (Stephane Mariel)
Original-Cc: gnu-win32 AT cygnus DOT com
X-Face:
%JjDwL,CM#gbv*uICrNLdM9yk_LRxMh3DV'.fQ>iw'N;7([Jq}2|J#5o".kzM&>7tW`8T^Z
buvRLp?jvQ+sbD3BND%=&D: lT%vT4p7cGcGRP5JO+F'^
X-Mailer: ELM [version 2.4ME+ PL31 (25)]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

> I'm trying to port a tcl module from unix to win95 as a dll to load within
> wish.
>
> So i tried to began with the example provided on cygnus.com , it works
> fine, i got my foo.dll, main.exe, but moving to my real software when I run
> ld I got:
> c:/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/lib/libcygwin.a(libccrt0.o)(.t
>
> ext+0x8a):libccrt0.cc: undefined reference to `GetModuleHandleA AT 4'
> c:/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/lib/libcygwin.a(libcmain.o)(.t
>
> ext+0xc):libcmain.cc: undefined reference to `GetModuleHandleA AT 4'
> c:/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/lib/libcygwin.a(libcmain.o)(.t
>
> ext+0x15):libcmain.cc: undefined reference to `GetCommandLineA AT 0'
> c:/gnuwin32/b18/H-i386-cygwin32/i386-cygwin32/lib/libcygwin.a(libcmain.o)(.t
>
> ext+0x1e):libcmain.cc: undefined reference to `WinMain AT 16'
>
> This seems to be a reentrancy problem, since a simple call like :
> fprintf(stderr, ...)

....for me this seems to be a forgotten '-lkernel32' at link-time :). The
undefined ref to 'WinMain' can be avoided with:

        echo 'int main() { return 0; }' > fixup.c;
        echo 'asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0");' >> fixup.c;
        gcc -c fixup.c
        # link fixup.o with your dll...

hth,

--- Roland.

---
Roland Geier                    Phone: ++49 (8505) 92182          
Universitaet Passau, GER 	Fax:   ++49 (8505) 922311
Lehrstuhl Prof. Dr. Donner      geier AT forwiss DOT uni-passau DOT de	
D-94032 Passau                  http://www.uni-passau.de/~geier/





-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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