From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3133 invoked by alias); 13 Nov 2011 12:59:31 -0000 Received: (qmail 3124 invoked by uid 22791); 13 Nov 2011 12:59:30 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_HD,TW_LC,TW_LG X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Nov 2011 12:59:16 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RPZeV-0006CB-Hx for cygwin@cygwin.com; Sun, 13 Nov 2011 13:59:15 +0100 Received: from p4fc609cc.dip0.t-ipconnect.de ([79.198.9.204]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 13 Nov 2011 13:59:15 +0100 Received: from philipp.kraus by p4fc609cc.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 13 Nov 2011 13:59:15 +0100 To: cygwin@cygwin.com From: Philipp Kraus Subject: Re: linker error libcygwin Date: Sun, 13 Nov 2011 12:59:00 -0000 Message-ID: References: <8DB56F04-18E5-43C3-8080-05565BA1531D@flashpixx.de> <4EBC3E14.9060000@sbcglobal.net> <4EBC730C.4070701@sbcglobal.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Unison/2.1.5 X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-11/txt/msg00220.txt.bz2 On 2011-11-13 12:43:37 +0100, Philipp Kraus said: > On 2011-11-11 01:57:48 +0100, Greg Chicares said: > >> On 2011-11-10 21:22Z, Philipp Kraus wrote: >>> On 2011-11-10 22:11:48 +0100, Greg Chicares said: >>> >>>> On 2011-11-10 20:39Z, Kraus Philipp wrote: >>>>> >>>>> undefined reference to `_WinMain@16' >>>>> collect2: ld returned 1 exit status >>>> >>>> Does this thread >>>> http://cygwin.com/ml/cygwin/2011-10/threads.html#00440 >>>> contain the answer? >>> >>> no, sorry. >>> >>>> If this is a console application, does it have >>>> an implementation of main()? >>> >>> yes the signature of the main is in this example: >>> int main(int argc, char* argv[]) >> >> Please show the full linker command, and indicate the name of >> the object file that contains main(). > > The full linker command shows (I split the flags for a better reading): > > g++ -o build/target.exe -mconsole -enable-stdcall-fixup -mthread > examples/other/target.o > > -L/usr/local/bin > -L/usr/bin > -L/cygdrive/c/Windows/system32 > -L/cygdrive/c/Windows > -L/cygdrive/c/Windows/system32/Wbem > -L/cygdrive/c/Windows/system32/WindowsPowerShell/v1.0 > "-L/cygdrive/c/Program Files/TortoiseSVN/bin" > "-L/cygdrive/c/Program Files/Java/jdk1.6.0_29/bin" > -L/cygdrive/c/opt/scons/bin > -L/cygdrive/c/opt/library/atlas/3.9.51/lib > -L/cygdrive/c/opt/library/boost/1.47.0/bin > -L/cygdrive/c/opt/library/boost/1.47.0/lib > -L/cygdrive/c/opt/library/cln/1.3.2/lib > -L/cygdrive/c/opt/library/ginac/1.6.1/lib > -L/cygdrive/c/opt/library/hdf/5-1.8.7/lib > -L/cygdrive/c/opt/library/xml2/2.7.8/bin > -L/cygdrive/c/opt/library/xml2/2.7.8/lib > -L/cygdrive/c/opt/library/jsoncpp/0.5.0/lib > > -lboost_system > -lboost_thread > -lboost_iostreams > -lboost_regex > -lboost_program_options > -lboost_exception > -lboost_filesystem > -llapack > -lcblas > -lf77blas > -latlas > -lgfortran > -lhdf5_cpp > -lhdf5 > > I have tested the same call with another example (only the *.cpp / *.o > file changes) and it works. The difference is the cpp code, but > a compiler call run's without an error. I don't understand why > different sources with the same linker command creates different > results. > The linking process should be deterministic, so the compiled object > code creates the same linker calls. I have checked my sources, but some examples must have this preprocessor part: #if defined(_WIN32) || defined(__CYGWIN__) #include #endif and some examples must not have this part (same linker / compiler call) -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple