eclipse – unresolved inclusion: <stdio.h>

26,215次阅读
一条评论

共计 719 个字符,预计需要花费 2 分钟才能阅读完成。

eclipse上配置好cdt后,新建一个简单的项目测试下,当写入头文件时,却出现如下错误提示:

unresolved inclusion: <stdio.h>

原因与解决:

这是c/c++标准库未设置所致。解决方法如下。

选中项目,依次操作:

右键单击 -> properties -> C/C++ General -> Paths and Symbols -> Add…  -> file system.

然后选择c/c++库的位置:/usr/include

如此再继续添加/usr/include/c++路径。确定后即可

参考:

Eclipse reports Unresolved inclusion for system headers such as stdio.h if it cannot locate the header files for a project. You can resolve this by right-clicking on the project in the Project Explorer view and then selecting Properties… from the context menu. In the dialog box, select: C/C++ General → Paths and Symbols → Add… and then add the path to the ARM Compiler headers on your host workstation. For example, C:Program FilesDS-5include. Select both Add to all configurations and Add to all languages, click on Apply so that Eclipse can rebuild the index.
 

正文完
 0
任侠
版权声明:本站原创文章,由 任侠 于2012-08-01发表,共计719字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(一条评论)
验证码
任侠001
2012-08-01 17:40:59 回复

Windows–>Preferences–>C/C++找到Environment。增加两个变量:

CPLUS_INCLUDE_PATH: /usr/include/c++/4.1.3(我的gcc版本)

C_INCLUDE_PATH: /usr/include

     中国北京北京市鹏博士