• Cmake构建编译报错查询


    1 在MAC环境构建Xcode工程:

    cmake -B build ****  -G Xcode

    2报错

       CMake Error at CMakeLists.txt:2 (project):

       No CMAKE_CXX_COMPILER could be found.

    3查看错误日志

    在第2步报错后,我们先去找Cmake的错误日志:一般在CmakeFiles文件夹下会有这个文件:CMakeError.log

    打开看看:

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler:  
    Build flags: 
    Id flags:  
    
    The output was:
    1
    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
    
    
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler:  
    Build flags: 
    Id flags:  
    
    The output was:
    1
    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
    
    
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler:  
    Build flags: 
    Id flags:  
    
    The output was:
    1
    xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

    检查下命令行工具是否有安装:

    xcode-select --install 
    xcode-select: error: command line tools are already installed, use "Software Update" to install updates

     百度一下:

    https://www.cnblogs.com/huangfuql1314/p/8417597.html

    终端输入:sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

    之后在去上边第一步操作构建的目录下执行构建命令:

     cmake -B build **【自定义】*  -G Xcode

    好了。。。。。。

    切换xcode命令行版本
    
    sudo xcode-select --switch /指定版本的xcode路径Xcode.app 
    


    恢复默认的xcode命令行版本 当使用xcodebuild莫名其妙的出问题时,可以考虑使用此命令恢复 sudo xcode-select -r

    
    使用对话框安装命令行工具
    
    sudo xcode-select --install
    ————————————————
    
    原文链接:https://blog.csdn.net/holdsky/article/details/103066213
     
     
  • 相关阅读:
    Jmeter Ant Task如果报告中有错误,在邮件内容里面直接显示出来 系列2
    自动化测试的点点滴滴经验积累
    Java中通过SimpleDateFormat格式化当前时间:/** 输出格式:20060101010101001**/
    Good Bye 2015 A
    Codeforces Round #337 (Div. 2)B
    Codeforces Round #337 (Div. 2) A水
    hdu 1698 线段树 区间更新 区间求和
    hdu 1166线段树 单点更新 区间求和
    HDU2841 (队列容斥)
    15ecjtu校赛1006 (dfs容斥)
  • 原文地址:https://www.cnblogs.com/8335IT/p/16636818.html
Copyright © 2020-2023  润新知