This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc does not know about "new" and "delete"


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]