运行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

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

本文作者:清澈的澈

本文链接:https://www.cnblogs.com/lmc7/p/17531377.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   清澈的澈  阅读(102)  评论(0编辑  收藏  举报  
评论
收藏
关注
推荐
深色
回顶
收起
点击右上角即可分享
微信分享提示