g++ linker problem with libcygwin.a

Philipp Kraus philipp.kraus@flashpixx.de
Sat Oct 22 19:19:00 GMT 2011


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

undefined reference to `_WinMain@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/Program Files/TortoiseSVN/bin" "-L/cygdrive/c/Program 
Files/Java/jdk1.6.0_29/bin" -L/usr/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 
-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?



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

More information about the Cygwin mailing list