cmake生成Xcode项目时报错“No CMAKE_C_COMPILER could be found

原因是在命令行xcodeselect指向的是/Library/Developer/CommandLineTools生成xcode项目时,需要xcodeselect指向/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

如果设置xcodeselect之后仍旧报错“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 ‘Commandline 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进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注