Eclipse CDT 包含问题
我刚刚安装了 Eclipse CDT。现在,Eclipse 对于 Java 来说工作得很好,但对于 C 来说根本不起作用。我正在尝试编写一个简单的 Hello World 程序,我什至加载了 Hello World ANSI 预制项目。但是,无论我做什么,我的所有 #include 都会收到“未解决的包含:___”错误。
我花了半个小时试图找出原因,安装了 MiniGW 并尝试了很多不同的配置。有人可以告诉我如何解决这个问题吗?我猜这是因为 Eclipse 不知道 .h 文件在哪里。我该如何设置这个?
我使用的是 Windows 7。
I just installed Eclipse CDT. Now, Eclipse works fine for me with Java, but it's not working at all with C. I'm trying to write a simple Hello World program, and I've even loaded the Hello World ANSI premade project. However, regardless of what I do, I get a "Unresolved Inclusion: ___" error on all my #include.
I've looked around for half an hour trying to figure out why, installed MiniGW and tried a ton of different configurations. Can someone tell me how to fix this? I'm guessing it's because Eclipse has no idea where the .h files are. How do I set this?
I'm on Windows 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转到项目属性(右键单击左侧面板中的项目),然后转到“C/C++ 常规”,然后转到“路径和路径”。符号。
您可以在“包含”选项卡中配置包含路径(通常是第一个)。
包含路径必须类似于 $MINGW_DIR/include 或类似的东西(不能更精确,对我来说它是 /usr/include 所以...)
Go to the project property (right click on the project in the left panel) then C/C++ General then Paths & Symbols.
You can configure the include paths in the Include tab (the first one normally).
The include paths must be something like $MINGW_DIR/include or something like that (can't be more precise, for me it's /usr/include so...)