Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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: <031a01c2dadb$bf7b0a40$666d86d9@webdev> From: "Elfyn McBratney" To: "cygwin" , "Wil Hunt" References: Subject: Re: DLL calling a DLL: undefined reference when linking. Date: Sun, 23 Feb 2003 01:34:45 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 > I think I'm making marvelous progress. Unfortunately, I'm getting an > error that doesn't make sense: > > $g++ -shared -mno-cygwin -o dllhello.dll dllhello.o > other.dll -Wl,--out-implib,libdllhello.a -Wl,--enable-stdcall-fixup > Creating library file: libdllhello.a > dllhello.o(.text+0x164):dllhello.C: undefined reference to `InitAPI AT 4' > > In my source code, the offending call is: > > extern "C" PASCAL void InitAPI( int handle ); Does dllhello.c include a header containing the prototype of InitAPI or have a declaration of InitAPI? I think that's the gotcha. Regards, Elfyn McBratney elfyn AT exposure DOT org DOT uk www.exposure.org.uk -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/