Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Mon, 11 Aug 2003 15:26:09 -0500 From: "Brian R. Gaeke" To: Ross Smith Cc: gaeke AT uiuc DOT edu, cygwin AT cygwin DOT com Subject: Re: ld -r errors with C++ objects Message-ID: <20030811202609.GA8450@niobe.cs.uiuc.edu> References: <79218202D4B9D4118A290002A508E13B79C3E6 AT PNZEXCHANGE> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79218202D4B9D4118A290002A508E13B79C3E6@PNZEXCHANGE> User-Agent: Mutt/1.4i > > When I link two particular .o files together into a new relocatable > > (using ld -r) I get errors from ld, instead of a new .o file. This > > happens in many of our C++ projects, but only on Cygwin. I have > > reduced the test cases significantly. > > ld doesn't speak C++. Use g++ to link C++ modules. Thanks for the advice. I tried using g++ for the link step. Ordinarily that results in ld complaining that it can't find WinMain, which makes sense because I am trying to link two .o files which do not constitute an entire program. I tried passing the -r option to ld using g++'s -Wl,-r option, so that it would not expect to see WinMain; that resulted in an error very similar to the one that I got before when I simply used ld -r. -- gaeke AT uiuc DOT edu -- 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/