“未解决的包含物”用于C标准库头的Eclipse CDT错误 [英] "Unresolved inclusion" error with Eclipse CDT for C standard library headers

查看:121
本文介绍了“未解决的包含物”用于C标准库头的Eclipse CDT错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为日食设置了CDT,并写了一个简单的hello world C程序:

  #include< stdio.h> 

int main(void){
puts(Hello,world。);
return 0;
}

程序生成并正确运行,但eclipse会持续显示此黄色问号

c code code code code code

它不影响程序的运行,但我觉得很讨厌。



有没有人有任何想法如何删除?

解决方案

Eclipse正在使用的编译器是能够解析的符号就好了,所以代码可以编译好。



但代码完成/预处理Eclipse正在使用不知道stdio.h存在的位置。



您需要指定文件系统路径stdio。 h位于。



请参阅: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/tasks/cdt_t_proj _paths.htm


I set up CDT for eclipse and wrote a simple hello world C program:

#include <stdio.h>

int main(void){
    puts("Hello, world.");
    return 0;
}

The program builds and runs correctly, but eclipse keeps showing this yellow question mark by the side of inclusion statement that says "Unresolved inclusion: <stdio.h>" when I put mouse over it.

It doesn't affect running of the program but I find it rather annoying.

Does anyone have any idea how to remove it ?

解决方案

The compiler Eclipse is using is able to resolve the symbols just fine, so the code will compile fine.

But the code-completion/preprocessor Eclipse is using doesn't know where stdio.h exists.

You need to specify the filesystem path where stdio.h is located.

See: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_paths.htm

这篇关于“未解决的包含物”用于C标准库头的Eclipse CDT错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆