X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Wed, 10 Apr 2002 16:25:53 +0300 (WET) From: Andris Pavenis X-Sender: pavenis AT ieva06 To: Hans-Bernhard Broeker Cc: djgpp AT delorie DOT com Subject: Re: making dxe2gen with clio.rice.edu binaries -or- "undefined reference to 'operator'"? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 10 Apr 2002, Hans-Bernhard Broeker wrote: > Eli Zaretskii wrote: > > > I think there's a confusion between compilation and linking. `gcc' knows > > friom the file-name extension it's a C++ program, so it compiles it as > > such; but it does _not_ instruct the linker to scan the C++ libraries. > > `gpp' does the latter. > > Hmm... yes, looks like it (tested with GCC-2.95.2 on Linux). I'm > surprised. I was pretty certain that if you did linking and > compilation in one go, gcc recognized that the source file(s) are in > C++, so the C++ runtime should be linked in automatically. I.e. I thought > > gcc -o hello hello.cpp > > worked. Turns out it doesn't ;-( > > Time for a memory reboot, it seems. Known thing. Part of C++ support which was earlier in libgcc.a is now no more there. One can link with libsupcxx.a which contains only this stuff moved out of libgcc.a). Anyway the same stuff is also in libstdcxx.a so one can use that. The difference is with dynamic linking where it's supported (why to have to require libstdc++ when C++ standard program library is not used). Anyway one can try to compile source using options -fno-rtti -fno-exceptions and in this case maybe one can avoid use of one of libstdcxx.a or libsupcxx.a One more thing is that using libstdcxx.a requires to link with libm.a more often than with previous GCC versions. gpp.exe does that automatically. Andris