X-Spam-Check-By: sourceware.org Message-ID: Date: Thu, 3 Aug 2006 08:34:46 +0800 From: "=?GB2312?B?08K6wg==?=" To: cygwin AT cygwin DOT com Subject: what is the difference of these two compile methods ? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 source file is a very simple cpp file like "hello world" whose name is main.cpp when i compile it with: g++ -o test.exe main.cpp it works fine but when i compile it with: g++ -c -o main.o main.cpp ld -o test.exe main.o it will report "undefined reference" error at step 2, it looks like ld can not locate any library, if i replace ld with g++, it works fine. -- 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/