问题
(This is my first question ever on StackOverflow)
I have to use a Mac at work, and I'm coding in C++ with Code::Blocks (because I am used to this IDE). 2 days ago I upgraded from MacOS High Sierra to MacOS Mojave and I can fairly say that... it was a bad decision.
Now, when trying to #include <math.h>
I get this error : fatal error: sys/cdefs.h: No such file or directory
. I have tried to reinstall the xcode line command tools with xcode-select --install
, but it still doesn't work.
Does anybody have a clue of what is going on, and how I could solve this issue ?
回答1:
The accepted answer doesn't seem to work for me, but this did:
cd /Library/Developer/CommandLineTools/Packages/
open .
and double clicking the pkg file.
回答2:
Problem solved by reinstalling gcc. Location of headers has probably changed between High Sierra and Mojave.
I suggest to anyone encountering the same problem to do the same and also to (re)install the xcode line command tools with xcode-select --install
来源:https://stackoverflow.com/questions/52517784/codeblocks-c-compiling-with-macos-mojave-fatal-error-sys-cdefs-h-no-such