|
From: Cesar S. <ces...@gm...> - 2010-05-13 22:39:29
|
On 13/5/2010 07:14, zwz wrote: > [ 0%] Generating precomp.hpp.gch/opencv_imgproc_Release.gch > d:/gnu/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(main.o):main.c:(.text+0xd2): > undefined reference to `WinMain@16' > collect2: ld returned 1 exit status > Could you show the full gcc command line? When generating a precompiled header, please make sure you do not have any linker flag on the command line or, if you do, use it together with -c. Example: $ echo "extern int i;" > pch.h $ gcc pch.h (Success) $ gcc -Wl,--enable-auto-import pch.h c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16' collect2: ld returned 1 exit status (Failure) $ gcc -Wl,--enable-auto-import -c pch.h (Success again) Regards, Cesar |