This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linker: Bug or Feature?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]