Hi Gurus ! I have a problem with cygwin gcc (gcc version 3.3.1 cygwin-special) - i think that i just don't understand "ld" - so maybe someone can help me ....
For my "Application-Framework" i need to put WinMain(...) in a lib - but it doesnt work - please take a look on a minimalistic example: <snip--------------------------------------------------------/> /* winmain.cc */ #include <windows.h> extern "C" void NewEntry(); extern "C" int APIENTRY WinMain(HINSTANCE hI,HINSTANCE hPI, LPSTR lpCmdLine,int nCmdShow) { NewEntry(); return 0; } <snip--------------------------------------------------------/> /* test.cc */ #include <windows.h> extern "C" void NewEntry() { MessageBox(NULL,"test","test",MB_OK); } ------------ making test.exe with: g++ -c winmain.cc g++ -c test.cc g++ -mwindows -mno-cygwin -o test.exe winmain.o test.o is ok -> running test.exe gives you a wonderfull MessageBox ... BUT: g++ -c winmain.cc g++ -c test.cc ar -rs libmaintest.a winmain.o g++ -mwindows -mno-cygwin -o test.exe test.o -L./ -lmaintest /usr/lib/gcc-lib/i686-pc-mingw32/3.3.1/../../../../i686-pc-mingw32/lib/libmingw32.a(main.o)(.text+0x9b):main.c: undefined reference to [EMAIL PROTECTED]' collect2: ld returned 1 exit status Why ld can't find [EMAIL PROTECTED] - nm -g libmaintest.a gives: winmain.o: U _NewEntry 00000000 T [EMAIL PROTECTED] Calling the linker with my lib "before" test.o, i.e. g++ -mwindows -mno-cygwin -o test.exe -L./ -lmaintest test.o gives the same ... I'm hanging around for two days with this ;-( TIA and Thank You, Spasibo, Danke, Merci .... Georg -- 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/