Mail Archives: djgpp/1999/11/04/05:42:38
On Wed, 3 Nov 1999, =?big5?B?rdu6+y+kcKjfpGw=?= wrote:
Please don't post in HTML.
> I have a problem in linking. I use gcc -c *.c *.cc to compile my source =
> code(one c file, and other c++ files).
> Then I use gxx -o test.exe *.o to link. There is a linking error:
>
> TDT3_I_10.o(.text+0x1195):TDT3_I_10.cc: undefined reference to =
> 'mytag(FILE*,FILE*)'
>
> mytag(FILE*,FILE*)is in mytagf.c
C functions called from C++ programs need to be declared as ``extern "C"''
in the prototypes visible to the C++ compiler that compiles C++ code which
calls those C functions.
See the DJGPP system headers for how this is done.
This is explained in section 8.10 of the FAQ, btw.
- Raw text -