【发布时间】:2013-11-22 02:32:16
【问题描述】:
我刚刚在windows中安装了mingw,我写了一个helloWorld程序来测试它。代码:
#include <stdio.h>
int main(){
printf("hello, world!\n");
return 0;
}
结果:
C:/MinGW/lib/crt2.o:crt1.c:(.text+0x1f1): undefined reference to `__chkstk_ms'
C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x5e3): undefined reference to `__chkstk_ms'
C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x690): undefined reference to `__chkstk_ms'
C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x7e9): undefined reference to `__chkstk_ms'
C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x82d): undefined reference to `__chkstk_ms'
C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0xc0d): more undefined references to `__chkstk_ms' follow
here 也有类似的问题。但是我检查了 MinGW 安装管理器,似乎我没有安装旧版本的 gcc 或 g++。有小伙伴可以帮忙吗?谢谢!
顺便说一句,由于我使用pythonxy作为我的python环境,所以我的C:下还有一个C:/MinGW32-xy目录,它不包含在系统变量'path'中。那会影响吗?
【问题讨论】:
-
尝试删除 C:\Mingw 文件夹重新运行安装管理器
-
你是怎么编译的?
-
我正在尝试在 sublime text3 中构建它。但是,我也使用了 cmd line: "gcc -o filename.exe filename.c" 仍然得到同样的错误。