3

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.

Tarmo
  • 3,728
  • 1
  • 8
  • 25
Ishu Dhariwal
  • 43
  • 1
  • 5

4 Answers4

4

I have faced exactly the same problem as you a few days ago after updating my MacBook M1 on the Monterey. Frankly, I didn't go into too much detail about the situation, but after finding out the reason for this behaviour it became clear, that include files like stdio.h and other disappeared miraculously. So in the end, a single command in the terminal helped -

xcode-select --install

I hope that it will help you to solve the problem.

Trí Phan
  • 1,123
  • 2
  • 15
  • 33
0

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.
DischordDynne
  • 117
  • 15
  • That doesn't seem to work it is still showing the same error . Can u walk me through more precisely what to do. – Ishu Dhariwal Oct 31 '21 at 15:52
  • Hmm. Is there file you are trying to link to in the same directory? Is it another file in the same directory? Like are you trying to compile multiple files? Or is this a library? – DischordDynne Oct 31 '21 at 18:20
0

Before installing any command line tools just take a look at your Xcode, it might not be installed. First install it, after that you can try running this command

xcode-select --install

This worked for me. Hope it helps:)

-1

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.
Giggity
  • 54
  • 1
  • 7
  • this requires a developer account it is showing not eligble to me – Ishu Dhariwal Nov 01 '21 at 19:15
  • If you already have an Apple ID, you'll just need to agree to Apple's Developer Agreement to turn it into a free developer account. Type in your Apple ID and click Sign In. If you don't already have an Apple ID, you'll need to create one first. – Giggity Nov 01 '21 at 19:18
  • Yeah i tried the same but its showing that your apple id is not eligible – Ishu Dhariwal Nov 01 '21 at 20:50
  • "Two-factor authentication is required for developer program Account Holders to sign in to their Apple Developer account". Is it enabled ? – Giggity Nov 01 '21 at 21:21
  • actually my apple id was my phone number and the appple representative told me that u can sign in as a developer with an apple id with ur email . i got it figured out though using brew. Thanks – Ishu Dhariwal Nov 06 '21 at 02:09