使用MacOS Mojave的Code :: Blocks C ++编译:致命错误:sys/cdefs.h:没有这样的文件或目录 [英] Code::Blocks C++ compiling with MacOS Mojave : fatal error: sys/cdefs.h: No such file or directory
问题描述
(这是我有关StackOverflow的第一个问题)
(This is my first question ever on StackOverflow)
我必须在工作中使用Mac,并且我正在使用Code :: Blocks进行C ++编码(因为我已经习惯了此IDE). 2天前,我从MacOS High Sierra升级到了MacOS Mojave,我可以说...这是一个错误的决定.
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.
现在,当尝试使用#include <math.h>
时,出现此错误:fatal error: sys/cdefs.h: No such file or directory
.我试图用xcode-select --install
重新安装xcode行命令工具,但仍然无法正常工作.
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 ?
推荐答案
通过重新安装gcc解决了问题.标头的位置可能在High Sierra和Mojave之间发生了变化.
Problem solved by reinstalling gcc. Location of headers has probably changed between High Sierra and Mojave.
我建议遇到相同问题的任何人都要做同样的事情,并且还建议使用xcode-select --install
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
这篇关于使用MacOS Mojave的Code :: Blocks C ++编译:致命错误:sys/cdefs.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!