Code::Blocks C++ compiling with MacOS Mojave : fat

2019-06-04 11:18发布

(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 ?

2条回答
再贱就再见
2楼-- · 2019-06-04 11:23

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.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-06-04 11:43

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

查看更多
登录 后发表回答