Sam Mullinix
Sam Mullinix

Reputation: 306

Header Files not Working in CLion after Xcode update

Apple sent out an Xcode update today and little did I know it would mess with my all of my header files.

The header file I am attempting to use is time.h. I know the code if fully functional because an online C++ shell will run it fine but CLion is telling me Cannot find 'time.h'. When I attempt to run the program I receive the following:fatal error: 'wchar.h' file not found. This was odd because I was able to locate the wchar.h file.

As per this post, I have followed all the instructions to no avail. I have also checked the location of the Command Line Tools with xcode-select -p and received that they are in /Library/Developer/CommandLineTools, which seems to be correct. I have also checked that gcc is working and the correct version. Any time I try xcode-select --install at this point it just tells me that it is installed and check for updates if I think it is wrong. It also told me there were no updates.

The only other thing I can think of is that the compiler is also telling me the following:

clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk' [-Wmissing-sysroot]

And after checking this directory, I noticed that my sdk is MacOSX 10.13 where the compiler was looking for 10.12. Also my SDK is just a 10 byte alias file that OS X tells me can't be found when I click on it?

I am really scratching my head on this one, I have re-installed Xcode already just as a last resort to no avail. Any help would be much appreciated.

Upvotes: 1

Views: 2622

Answers (1)

Leland Wallace
Leland Wallace

Reputation: 228

You need to change the sdk your project is using. Go to your Target and look at the Build Settings. Set the Base SDK popup to "Latest Mac OS(...)" and you should be good to go.

Upvotes: 1

Related Questions