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 Content-Type: text/plain; charset="iso-8859-1" From: Tim Prince Reply-To: tprince AT computer DOT org To: LEE LIK CHUAN , cygwin AT cygwin DOT com Subject: Re: Problem with ld on cygwin Date: Thu, 5 Sep 2002 06:12:09 -0700 References: <20020905094938 DOT 8446 DOT qmail AT web10708 DOT mail DOT yahoo DOT com> In-Reply-To: <20020905094938.8446.qmail@web10708.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020905131209.77AEB2CB0D@inet1.ywave.com> On Thursday 05 September 2002 02:49, LEE LIK CHUAN wrote: > Hi > > I have download cgywin and installed on my computer. > However when i try to build a program by the command: > > ld test.o > > i got the following msg: > > ld: warning: cannot find entry symbol _mainCRTStartup; > defaulting to 00401000 > test.o(.text+0xb):test.cpp: undefined reference to > `__main' > test.o(.text+0x13):test.cpp: undefined reference to > `endl(ostream &)' > test.o(.text+0x20):test.cpp: undefined reference to > `cout' > test.o(.text+0x25):test.cpp: undefined reference to > `ostream::operator<<(char co > nst *)' > This is somewhat OT for cygwin, since you appear to be asking ld to guess which libraries you need. The g++ command would tell ld about the libraries normally required for a C++ link. -- Tim Prince -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/