我刚在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
这里有一个类似的问题在这里。但我检查了MinGW安装管理器,似乎没有安装旧版本的gcc或g++。有人能帮忙吗?谢谢!
顺便说一下,由于我使用pythonxy作为我的python环境,在我的C:下也有一个C:/MinGW32-xy目录,它没有包含在系统变量'path'中。那会影响吗?