ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

解决ubuntu18.04使用vcpkg安装库出现的一个问题

2021-03-24 09:32:57  阅读:582  来源: 互联网

标签:cmake DVCPKG x64 book vcpkg linux ubuntu18.04 安装


报错描述如下

book@100ask:~/vcpkg$ vcpkg install freetype
Computing installation plan...
The following packages will be built and installed:
  * brotli[core]:x64-linux -> 1.0.9#1
  * bzip2[core]:x64-linux -> 1.0.8#1
    freetype[brotli,bzip2,core,png,zlib]:x64-linux -> 2.10.4
  * libpng[core]:x64-linux -> 1.6.37#14
  * zlib[core]:x64-linux -> 1.2.11#9
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Error: while detecting compiler information:
The log content at /home/book/vcpkg/buildtrees/detect_compiler/stdout-x64-linux.log is:
-- Configuring x64-linux-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:105 (message):
    Command failed: /home/book/vcpkg/downloads/tools/cmake-3.19.2-linux/cmake-3.19.2-Linux-x86_64/bin/cmake /home/book/vcpkg/scripts/detect_compiler -DCMAKE_MAKE_PROGRAM=/home/book/vcpkg/downloads/tools/ninja-1.10.1-linux/ninja -DCMAKE_SYSTEM_NAME=Linux -DBUILD_SHARED_LIBS=OFF -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/home/book/vcpkg/scripts/toolchains/linux.cmake -DVCPKG_TARGET_TRIPLET=x64-linux -DVCPKG_SET_CHARSET_FLAG=ON -DVCPKG_PLATFORM_TOOLSET=external -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_APPLOCAL_DEPS=OFF -DCMAKE_TOOLCHAIN_FILE=/home/book/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -DVCPKG_CXX_FLAGS= -DVCPKG_CXX_FLAGS_RELEASE= -DVCPKG_CXX_FLAGS_DEBUG= -DVCPKG_C_FLAGS= -DVCPKG_C_FLAGS_RELEASE= -DVCPKG_C_FLAGS_DEBUG= -DVCPKG_CRT_LINKAGE=dynamic -DVCPKG_LINKER_FLAGS= -DVCPKG_LINKER_FLAGS_RELEASE= -DVCPKG_LINKER_FLAGS_DEBUG= -DVCPKG_TARGET_ARCHITECTURE=x64 -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_BINDIR:STRING=bin -D_VCPKG_ROOT_DIR=/home/book/vcpkg -D_VCPKG_INSTALLED_DIR=/home/book/vcpkg/installed -DVCPKG_MANIFEST_INSTALL=OFF -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/book/vcpkg/packages/detect_compiler_x64-linux
    Working Directory: /home/book/vcpkg/buildtrees/detect_compiler/x64-linux-rel
    Error code: 1
    See logs for more information:
      /home/book/vcpkg/buildtrees/detect_compiler/config-x64-linux-rel-out.log
      /home/book/vcpkg/buildtrees/detect_compiler/config-x64-linux-rel-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:343 (vcpkg_execute_required_process)
  scripts/detect_compiler/portfile.cmake:18 (vcpkg_configure_cmake)
  scripts/ports.cmake:142 (include)



Error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.

解决办法如下
打开/home/book/vcpkg/scripts/buildsystems/vcpkg.cmake这个文件在第24行添加两行代码
SET (CMAKE_C_COMPILER_WORKS 1)
SET (CMAKE_CXX_COMPILER_WORKS 1)

就可以正常下载安装库了

标签:cmake,DVCPKG,x64,book,vcpkg,linux,ubuntu18.04,安装
来源: https://blog.csdn.net/qq_32856147/article/details/115160398

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有