Netbeans:找不到包含文件< iostream>,也无法解析标识符std,cout [英] Netbeans: cannot find include file <iostream>, also, unable to resolve identifier std, cout

查看:1099
本文介绍了Netbeans:找不到包含文件< iostream>,也无法解析标识符std,cout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Netbeans上的所有C ++项目中都收到了上述错误。我也收到了我试图包含的其他任何错误。以下是我控制并将鼠标悬停在其上时所说的内容: http://imgur.com/bBF2xuB 。其中一个项目实际构建并运行得很好,但所有其他项目都失败了构建失败,退出值2或运行失败,运行失败,退出值127。我完全不知道如何解决这个问题,而我所寻求的一切都试图解决这个问题并没有帮助。几个月前,当我使用Netbeans时,这不是问题,我不确定为什么问题会自发出现。

I'm receiving the above errors on all my C++ projects on Netbeans. I also receive cannot find errors for anything else I try to include. Here's what it says when I hold control and hover over it: http://imgur.com/bBF2xuB. One of the projects actually builds and runs just fine, but all the rest fail either with "build failed, exit value 2" or the run fails with "run failed, exit value 127". I have absolutely no idea how to fix this and everything I've looked up to try to solve this hasn't helped. This wasn't a problem a few months ago when I was using Netbeans, and I'm not sure why the problem spontaneously popped up.

我刚刚安装了Netbeans 8.0和最新的cygwin版本试图解决这个问题,但无济于事。我正在运行Windows 7.
请帮助,我们将不胜感激。

I just freshly installed Netbeans 8.0 and the latest cygwin version to try to fix this, but to no avail. I'm running Windows 7. Please help, it would be greatly appreciated.

编辑
附加照片中突出显示的红色错误是文件/文件夹实际上不存在。这可能是问题,如果是这样,我该怎么办呢?

EDIT The highlighted red errors in the attached photo are files/folders that do not actually exist. Could this be the problem, and if so, how can I go about fixing it?

编辑2
我删除或更改了一些不存在的文件/ C / C ++选项卡下的代码辅助选项卡中的/ folder路径,这似乎已经使编辑器中的一些错误消失了,但我仍然无法构建项目(并且错误并没有消失在此特定项目),我过去创建的项目正常建设,但我仍然收到RUN FAILED退出值127。

EDIT 2 I deleted or changed some of the non-existent file/folder paths in the code assistance tab under the C/C++ tab under the options, this seems to have made some of the errors in the editor go away, but I still cannot build the project (and the errors haven't disappeared on this specific project), and the projects that I created in the past that used to work just fine are building, but I'm still receiving "RUN FAILED exit value 127".

推荐答案

我和Netbeans(8.0.2)在Linux上无法找到包含(找不到包含文件)的经历相同。

I just had the same experience with Netbeans (8.0.2) not being able to find includes ("Cannot find include file") on Linux.

我必须执行以下操作:


  1. 在C / C ++设置下的构建工具选项卡中,单击恢复默认值,让它重新扫描工具,然后选择所有可执行文件的路径。选择新配置的工具集作为默认值和/或删除旧工具集以减少混淆。


  1. 在 代码帮助,确保选择了正确的工具集,然后单击重置设置和应用。这填补了所有必要的路径。


  1. 在我的项目设置中,确保我使用了正确的(新发现的)工具收集。

此后,所有包含都被正确选中,错误从源检查中消失。

After this, all the includes were picked up correctly and errors disappeared from the source checking.

这篇关于Netbeans:找不到包含文件< iostream>,也无法解析标识符std,cout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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