Dev-C++中编译C语言报错

环境:先装了MinGW,又装了Dev-C++,编译c的时候报错

 

 i:\gw\lib\crt2.o(.text+0x8) In function `_mingw_CRTStartup':
  [Linker error] undefined reference to `__dyn_tls_init_callback' 
  [Linker error] undefined reference to `__cpu_features_init' 
 i:\gw\lib\crt2.o(.text+0x8) ld returned 1 exit status 
 

 

解决办法:Tools-->Compiler Options-->Directories-->Libraries,加入MinGW目录下的lib,并将之移至最上方,“OK”即可,使C编译的时候,优先选择MinGW的lib编译.

你可能感兴趣的:(C++)