Date: Thu, 4 Nov 1999 09:14:02 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: =?big5?B?rdu6+y+kcKjfpGw=?= cc: djgpp AT delorie DOT com Subject: Re: Linking problem In-Reply-To: <000e01bf25d1$0469d320$551f708c@csie.ntu.edu.tw> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.