From: lat@iki.fi (Lassi A. Tuura)
Subject: Re: Linker: Bug or Feature?
7 Nov 1998 00:57:13 -0800
Message-ID: <Pine.LNX.3.96.981106142450.25468o-100000.cygnus.gnu-win32@pcatlas112.cern.ch>
References: <C12566B3.004AFB18.00@notes.kuttig.com>
Reply-To: "Lassi A. Tuura" <lat@iki.fi>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: mvoss@kuttig.com
Cc: gnu-win32@cygnus.com

|> I get an "undefined reference to asmfunctionfoo...", the function in
|> the .asm / .o file.  [renaming .cpp to .c works]

The C file probably says `extern int asmfunctionfoo (...)'?  If the file
extension is `.cpp', GCC compiles the file as C++ and function names
will be mangled, e.g. `int asmfunctionfoo (void)' would become something
like `asmfunctionfoo__Fv'.  If it is compiled as C, the name is not
mangled and the link succeeds.  If you want to compile it as C++, use
`extern "C"' instead of `extern'. 

Hope this helps,
//lat
--
With sufficient thrust, pigs fly just fine.  However, this is not
necessarily a good idea.  It is hard to be sure where they are going
to land, and it could be dangerous sitting under them as they fly
overhead.  --RFC1925, "The Twelve Networking Truths"

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