X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Lewis Hyatt Subject: Re: gcc does not know about "new" and "delete" Date: Fri, 21 Sep 2007 14:35:05 -0400 Lines: 16 Message-ID: References: <46F40C47 DOT 3040005 AT research DOT telcordia DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <46F40C47.3040005@research.telcordia.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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/