**** Internal Builder is used for build ****
gcc -O0 -g3 -Wall -c -fmessage-length=0 -oserver.o ..\server.c
gcc -otcpsrv.exe server.o -lws2_32
d:/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1013 ms.
原因,没写main函数...
gcc -O0 -g3 -Wall -c -fmessage-length=0 -oserver.o ..\server.c
gcc -otcpsrv.exe server.o -lws2_32
d:/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../libmingw32.a(main.o):main.c:(.text+0xd2): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1013 ms.
原因,没写main函数...
本文分析了一次使用GCC编译过程中出现的错误原因,主要由于未定义`WinMain`入口函数导致编译失败。通过本案例,读者可以了解如何解决类似的编译问题。
10万+

被折叠的 条评论
为什么被折叠?



