codeblocks编译c可以,编译c++一堆错误
codeblocks 版本号16.01
mingw版本号 0.6.2-beta-20131004-1
一个简单地c++程序
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
出现了如下错误
||=== Build: Debug in helloworld (compiler: GNU GCC Compiler) ===|
d:codeblockmingwmingwincludesysstat.h|173|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: '_ino_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: '_mode_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: '_off_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|173|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: '_ino_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: '_mode_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: '_off_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|180|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: '_ino_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: '_mode_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: '__off64_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|188|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '_ino_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '_mode_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '_dev_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '__off64_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '__time64_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '__time64_t' does not name a type|
d:codeblockmingwmingwincludesysstat.h|195|error: '__time64_t' does not name a type|
d:codeblockmingwmingwincludeio.h|335|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludeio.h|335|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludeio.h|335|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludeio.h|336|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludeio.h|336|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludeio.h|336|error: 'time_t' does not name a type|
d:codeblockmingwmingwincludeio.h|362|error: '__time64_t' does not name a type|
d:codeblockmingwmingwincludeio.h|362|error: '__time64_t' does not name a type|
d:codeblockmingwmingwincludeio.h|362|error: '__time64_t' does not name a type|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|146|error: '::fwide' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|153|error: '::mbsinit' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|164|error: '::vfwscanf' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|170|error: '::vswscanf' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|174|error: '::vwscanf' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|191|error: '::wcstof' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|198|error: '::wmemcmp' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|199|error: '::wmemcpy' has not been declared|
d:codeblockmingwmingwlibgccmingw324.9.3includec++cwchar|200|error: '::wmemmove' has not been declared|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
编译器配置如下
已检查环境变量,配置如下
本来一直在写c,编译正常。
昨天导师让熟悉c++,写了一个hello world的程序发现无法正常编译,build的时候已经出了问题,怀疑是编译器配置有问题,但我reset default 后,重新按照教程配置依然不可以。
有资料说
把-std=c++11修改为-std=gun++11
但我不理解,也不知道要怎么改啊。
查阅过的资料地址:
跪求各位大神帮助,要哭了/(ㄒoㄒ)/~~
工程的 properties下的build target
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我是安装好就可以用的,又一次想用codeblocks做了下winsock编程,改了下编译器,后来就和你一样了。
和你一样找了很多方法,都没用。
在我把之前勾选的选项,全取消,之后就没有任何问题了:
你的
Global Compiler settings
中的C++ compiler
改成mingw32-g++.exe
用
gcc
编译cpp
虽然在linux
下好使~~在windows
下可不一定。。:)还有在我的机器上
Linker for dynamic libs
的也是mingw32-g++.exe
。