Can't compile C program on a Mac after upgrade to Mojave

前端 未结 15 1032
陌清茗
陌清茗 2020-11-22 06:58

I have used the gcc command on the terminal to compile C programs but all of a sudden, after an update to my Mac\'s OS (to macOS 10.14 Mojave, and XCode 10.0), I started rec

15条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 07:42

    The problem is that Xcode, especially Xcode 10.x, has not installed everything, so ensure the command line tools are installed, type this in a terminal shell:

    xcode-select --install

    also start Xcode and ensure all the required installation is installed ( you should get prompted if it is not.) and since Xcode 10 does not install the full Mac OS SDK, run the installer at

    /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

    as this package is not installed by Xcode 10.

提交回复
热议问题