cmake 报错 no c complier found

Cmake c complier could be not found

环境

macOS 11.6 big sur
xcode 13.2
commandline tool 已经安装
ios 项目开发

报错

具体代码如下

CMake Error at CMakeLists.txt:151 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:151 (project):
No CMAKE_CXX_COMPILER could be found.

解决

从上述报错代码来看,其实就是没有找到ios对应的sdk
进入文件夹

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer

进入SDKs子目录,发现只有iPhoneOS.sdk一个sdk,
制作替身:

将替身分别命名为iPhoneOS13.0.sdk iPhoneOS14.0.sdk iPhoneOS15.0.sdk
这样就能满足常规的使用了。

发表回复