Mail Archives: djgpp/1997/05/27/05:19:10
On Tue, 27 May 1997, Michiel de Jong wrote:
> the allegro library, and thats working fine. I have the source code of the
> libary and if I include the source in my project I still get these
> "undefined reference" errors, but if i paste the library code into the file
> in which i use the library the erros disappear (except for the part of the
> library source written in assembly, which i cannot paste into the C++ file
> (can I?)).
> If you have any suggestion, I would be most obliged.
Can it be that your library is C-code and your program is written
in C++?? And in that case you include in your source files the
header file for your library which declares the prototypes of
your functions but they are not surrounded by
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
endif
If you don't do this, gcc assumes that the functions in your
library are C++ functions which have a different name when they
are C-functions.
BTW: If my guess above is true, then you can see that all
the confusion comes simply by not emitting enough information
about your problem.
Robert
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -