Home > Software design >  vs code is throwing #include error on macOS monterey it worked fine on BigSur
vs code is throwing #include error on macOS monterey it worked fine on BigSur

Time:11-02

I updated to macOS monterey yesterday and my vs code is not compiling any code since then. It is throwing these errors :

#include errors detected. Please update your includePath. Squiggles are 
disabled for this translation unit (/Users/ishudhariwal/contest.cpp).

cannot open source file "endian.h" (dependency of "iostream")

It was working perfectly fine on BigSur. I am a beginner at programming. I can't figure out what's going wrong and how to fix it.

CodePudding user response:

If you are using the C/C Package by Microsoft you need to update your c_cpp_properties.json file located in the generated .vscode folder. Add this to your MacFrameworkPath:

"macFrameworkPath": [
     "/Library/Developer/**"            
],
``` This will include all the files you need from /Library/Developer. The ** looks through every folder inside that and on.

CodePudding user response:

Try installing Xcode Command-line Tools. Most probably this will solve the issue.

Try the following.

  1. Go to https://developer.apple.com/download/all/
  2. Login or sign up
  3. Look for: "Command Line Tools for Xcode 13.x" in the list of downloads then click the dmg and download.
  4. Install it.
  • Related