This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: gcc does not know about "new" and "delete"
- From: Lewis Hyatt <lhyatt at princeton dot edu>
- To: cygwin at cygwin dot com
- Date: Fri, 21 Sep 2007 14:35:05 -0400
- Subject: Re: gcc does not know about "new" and "delete"
- References: <46F40C47.3040005@research.telcordia.com>
This is what happens when I try to compile this program under cygwin on
my Windows XP machine:
% gcc newtest.cpp
/tmp/ccReoXoA.o:newtest.cpp:(.text+0x32): undefined reference to
`operator new(unsigned int)'
/tmp/ccReoXoA.o:newtest.cpp:(.text+0x5e): undefined reference to
`operator delete(void*)'
collect2: ld returned 1 exit status
gcc is compiling the C++ source fine, but it does not automatically
figure out that it needs to link in the c++ runtime. You have to call it
as "g++" instead. It works that way on Linux too.
-Lewis
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/