简体   繁体   中英

VS Code C++ extension gives error “namespace has no member function”

I am using VS Code on Ubuntu 16.10 and am working on a C++ project. I have been using it for a few days now, but just today the C++ extension was updated v0.11.1. After this upgrade a good portion of my main.cpp has red error squiggles under member functions. In the problems output from VS Code it says "namespace std has no member endl". It says that over and over for different members such as endl, cout, etc.

C++ extension changelog: https://marketplace.visualstudio.com/items/ms-vscode.cpptools/changelog

How can I get VS Code to recognize the members? When I compile from the terminal using g++ I don't receive any errors.

Things I've tried:

  • Reinstalling VS Code
  • Reinstalling the extension

I was able to find a fix for this. It was due to the C++ extension update to v0.11.1.

On GitHub there was an issue reported. If anyone needs to fix this before they release a patch, go to File -> Preferences -> Settings in VS Code and change "C_Cpp.intelliSenseEngine": "Default" to "C_Cpp.intelliSenseEngine": "Tag Parser" .

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