delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/10/22/15:19:13

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.3 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
To: cygwin AT cygwin DOT com
From: Philipp Kraus <philipp DOT kraus AT flashpixx DOT de>
Subject: g++ linker problem with libcygwin.a
Date: Sat, 22 Oct 2011 21:18:31 +0200
Lines: 43
Message-ID: <j7v4u7$il0$1@dough.gmane.org>
Mime-Version: 1.0
User-Agent: Unison/2.1.5
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hello,

I use Cygwin with g++ for compiling my source codes and on some codes I 
get the error:

/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../libcygwin.a(libcmain.o):(.text+0xa9): 
undefined reference to `_WinMain AT 16'

I link my sources to libraries like Boost, Atlas, LAPack...

All codes can be compiled under OSX and Linux without any warning / 
error. I've found the information that the
error is thrown, if the main method is not found, but all programs have 
the main methode like int main(int argc, char* argv[])
I try to solve the problem with a full reinstall of Cygwin but it does 
not run. The linker command
shows like:

g++ -o build/test.exe -enable-stdcall-fixup examples/test.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/usr/bin 
-L/cygdrive/c/opt/library/atlas/3.9.51/lib 
-L/cygdrive/c/opt/library/hdf/1.8.7/lib 
-L/cygdrive/c/opt/library/xml2/2.7.8/bin 
-L/cygdrive/c/opt/library/boost/1.47.0/bin -L/cygdrive/c/opt/library/boo
st/1.47.0/lib -L/cygdrive/c/opt/library/jsoncpp/0.5.0/lib 
-L/cygdrive/c/opt/scons/bin
-lcygboost_system -lcygboost_thread -lcygboost_iostreams 
-lcygboost_regex -lcygboost_program_options -lboost_exception 
-lcygboost_filesystem -llapack -lcblas -lf77blas -latlas -lgfortran 
-lhdf5_cpp -lhdf5

All depend libraries are build with Cygwin Gcc / G++ / GFortran also. 
I've found a lot of posting with the similar / equal problem, but no 
solution. Does anybody know a solution for the linker problem?

Thanks

Phil



--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019