Mail Archives: djgpp/2000/07/20/19:00:56
In article <3977519D DOT 1545FF4C AT puckbell DOT net>,
Tasci Synx <nospam AT puckbell DOT net> wrote:
>Hello, I was wondering if anyone might be able to help me. I compiled a
>number of object files, then used the 'ar' utility to make a single file
>out of them called libgame.a. I tried to include this with the my
>object files in another project, but received an error every time I
>tried to call a function in the library. It was as though there was no
>library in the first place.
Since changing the order of files listed didn't help,
is there perhaps some confusion about functions that need
to be declared extern "C"? If the library was compiled with
gcc (not gpp) as C functions, then the names won't be mangled
with type information. The C++ compiler (gpp) will be trying
to find mangled names, unless all the functions are declared
with extern "C".
Even more basic, I assume that the library was compiled
with gcc/gpp. Object modules from different compilers,
especially C++ object modules, often won't link together.
- Raw text -