X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3CAD6C24.495D4F57@phekda.freeserve.co.uk> Date: Fri, 05 Apr 2002 10:19:32 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: DJGPP newsgroup Subject: Re: making dxe2gen with clio.rice.edu binaries -or- "undefined reference to 'operator'"? References: <3ca78d87$0$364$9b622d9e AT news DOT freenet DOT de> <3cab2f26$0$152$9b622d9e AT news DOT freenet DOT de> <3cace922$0$12701$9b622d9e AT news DOT freenet DOT de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Hello. deckerben wrote: [snip] > Some compilers know, for instance, that they should automaticly try a full > C++ convention with source files that have the .cpp file extension, and an > ANSI C convention when they end with .c > > But my DJGPP installation was trying to compile a C++ file only using > default C libraries. Appearantly DJGPP does not support this > 'file-extension-recognition', or? Compiling and linking are different things. When you link with with gpp/gxx/g++ it will automatically link in the standard C++ library, e.g.: gxx -o foo foo.o bar.o Similarly gcc will link in the standard C library. Now if you link multiple C++ object files together using: gcc -o foo foo.o bar.o then how does gcc know you're linking C++ objects together? Answer: it doesn't. So you need to use gpp/gxx/g++ instead. Note that if you compile and link a C++ program in one line, then gcc knows it should link in the standard C++ library, because it knows its C++ from the file extension: gcc -g -Wall -o foo foo.cpp Bye, -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]