简体   繁体   中英

c++ netbeans shows syntax errors, but compiles and runs correctly

I installed NeatBeans IDE 8.1 fresh for C++ development and began a blank new project. The code for the project is shown below. The code within the editor shows a syntax error , although when building, THE CODE RUNS PERFECTLY FINE .

码

Although iostream is imported correctly, and I can view iostream.h by clicking on it, std seems to be completely undefined. In fact, I cannot use any library without it showing a syntax error. I realize that having an std in front of cout is redundant, since I am supposed to be using namespace std , but I just wanted to show that it is not just the namespace. I am using a 64 bit MinGW compiler as my configuration as pictured below.

包含目录

I have tried using all solutions online, such as Reparse project , but that and others do not seem to help rectify this issue. How can I make the editor show no syntax errors and build correctly?

I remember having this problem. I used to fix it by doing a "Run -> clean and build project".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM