在cmake生成Xcode项目时报错“No CMAKE_C_COMPILER could be found”
原因是在命令行中xcode–select指向的是/Library/Developer/CommandLineTools,生成xcode项目时,需要将xcode–select指向/Applications/Xcode.app/Contents/Developer
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
参考链接:https://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error/17980786#17980786
如果设置xcode–select之后仍旧报错“No CMAKE_C_COMPILER could be found”, 解决方案是:
cmake ../ -GXcode -DCMAKE_C_COMPILER="$(xcrun -find cc)" -DCMAKE_CXX_COMPILER="$(xcrun -find c++)"
如果CMake的输出log中提示下面错误时, 可以通过升级CMake版本来解决
“error: An empty identity is not valid when signing a binary for the product type ‘Command–line Tool’. (in target ‘CompilerIdCXX’ from project ‘CompilerIdCXX’)”
Xcode 14 beta: CMake not able to resolve CMAKE_C_COMPILER and CMAKE_CXX_COMPILER – Stack Overflow
原文地址:https://blog.csdn.net/Lesen14/article/details/129348204
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_20176.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!