Mail Archives: djgpp/1997/09/21/21:54:25
> I have problems in linking my c library-files to my cc main programm.
> When I compile the c library-files as cc-files, the problem disappears.
> But I donīt want to store two different versions of my libraries, one
> for cc main-files and one for the c main-files.
By "cc" I assume that you mean C++? The problem is, C++ does "name
mangling". That is, stuff is added to function names to encode information
about the number and types of parameters. Your C libraries will, obviously,
not have this. If you want to link a C compiled function with a C++ program
you need to do something like this:
extern "C"
{
int foo( int, int );
};
Virtually any book on C++ (and probably the DJGPP faq) will explain this
further.
--
"Don't waste our bandwidth with cliched catch phrases that were moldy
years ago. Be creative- surely with the plethora of bodily fluids, and
other excereta to draw upon you can come up with something a little more
original" -- Rhias K. Hall (badger AT wizards DOT com)
- Raw text -