注册 登录
编程论坛 Linux系统管理

Linux编译错误怎么办? 不是代码问题!

梦米奇 发布于 2013-12-13 15:04, 7951 次点击
源码:main.cpp
#include <stdio.h>

int main()
{

        return 0;
}

~# g++ main.cpp
结果:  出现下面一大堆错误,大神们  这个怎么办?求解决。。。
In file included from main.cpp:1:
/usr/include/stdio.h:28:23: error: features.h: No such file or directory
In file included from /usr/include/libio.h:62,
                 from /usr/include/stdio.h:72,
                 from main.cpp:1:
/usr/include/sys/cdefs.h:46:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:50:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:138:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:196:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:205:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:214:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:223:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:235:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:245:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:254:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:262:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:276:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:286:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:291:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:298:19: error: missing binary operator before token "("
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:214: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/stdio.h:46: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/stdio.h:62: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/sys/cdefs.h:46:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:50:44: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:138:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:196:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:205:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:214:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:223:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:235:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:245:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:254:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:262:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:276:19: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:286:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:291:20: error: missing binary operator before token "("
/usr/include/sys/cdefs.h:298:19: error: missing binary operator before token "("
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/stddef.h:214: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/stdio.h:46: error: expected constructor, destructor, or type conversion before ‘typedef’
/usr/include/stdio.h:62: error: expected constructor, destructor, or type conversion before ‘typedef’
1 回复
#2
zwhyk2013-12-21 17:50
系统没有标准库,也就是说没有stdio.h文件。这个站太冷漠了。你去下glic的标准库就可以了。
1