运行C时报错:relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain‘ collect2: error

写C时,遇到报错

[Running] cd "d:\考研\408\LeranC\Code\GramForC\" && gcc 01data_types.c -o 01data_types && "d:\考研\408\LeranC\Code\GramForC\"01data_types
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../lib/libcygwin.a(libcmain.o): in function `main':
/usr/src/debug/cygwin-3.1.4-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/usr/src/debug/cygwin-3.1.4-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x7f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status

[Done] exited with code=1 in 0.786 seconds

以为是自己瞎配置导致的,就重装了
结果还是会出现
其实原因是全局变量占用内存过大导致的

posted @ 2021-05-05 19:27  清澈的澈  阅读(81)  评论(0编辑  收藏  举报  来源