This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: WinMain in an own static lib -> _WinMain@16 undefined reference ?! ;.(


G.-B. Hauck wrote:
> g++ -mwindows -mno-cygwin -o test.exe test.o -L./ -lmaintest
> 
> /usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../../i686-pc-min
> gw32/lib/libmingw32.a(main.o)(.text+0x9b):main.c: undefined 
> reference to `_WinMain@16'
> collect2: ld returned 1 exit status

This isn't specific to Cygwin. Modules are only pulled from a
library if something else refers to them (the underlying MINGW
run-time reference doesn't count!).

Try adding -u_WinMain@16 to the command line.

-Jerry

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]