Windows 10 vcpkg install ** failed with: BUILD_FAILED #39179
Unanswered
ChiehWang123
asked this question in
Q&A
Replies: 2 comments
-
|
I have already installed the following requirements: |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
可以试试重新安装VS,我也遇到了类似的问题,可以在C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-out.log中找到更多的信息 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Windows 10 + VS2022
When I was executing vcpkg install json-c(the same applies to other packages), I got an error as follows:
C:\vcpkgsrc\test\build> vcpkg install json-c
warning: The vcpkg C:\vcpkgsrc\vcpkg\vcpkg.exe is using detected vcpkg root C:\vcpkgsrc\vcpkg and ignoring mismatched VCPKG_ROOT environment value D:\visualStudio\VC\vcpkg. To suppress this message, unset the environment variable or use the --vcpkg-root command line switch.
Computing installation plan...
warning: vcpkg appears to be in a Visual Studio prompt targeting x86 but installing for x64-windows. Consider using --triplet x86-windows or --triplet x86-uwp.
The following packages will be built and installed:
json-c:x64-windows@2023-08-12
Detecting compiler hash for triplet x64-windows...
Compiler found: D:/visualStudio/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
Restored 0 package(s) from C:\Users\wangjie\AppData\Local\vcpkg\archives in 161 us. Use --debug to see more details.
Installing 1/1 json-c:x64-windows@2023-08-12...
Building json-c:x64-windows@2023-08-12...
-- Using cached json-c-json-c-b4c371fa0cbc4dcbaccc359ce9e957a22988fb34.tar.gz.
-- Cleaning sources at C:/vcpkgsrc/vcpkg/buildtrees/json-c/src/a22988fb34-2c10eba8ac.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/vcpkgsrc/vcpkg/downloads/json-c-json-c-b4c371fa0cbc4dcbaccc359ce9e957a22988fb34.tar.gz
-- Applying patch pkgconfig.patch
-- Applying patch fix-clang-cl.patch
-- Using source at C:/vcpkgsrc/vcpkg/buildtrees/json-c/src/a22988fb34-2c10eba8ac.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
Command failed: D:/visualStudio/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe -v
Working Directory: C:/vcpkgsrc/vcpkg/buildtrees/json-c/x64-windows-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-dbg-CMakeCache.txt.log
C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-rel-CMakeCache.txt.log
C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-out.log
Call Stack (most recent call first):
installed/x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:261 (vcpkg_execute_required_process)
ports/json-c/portfile.cmake:14 (vcpkg_cmake_configure)
scripts/ports.cmake:175 (include)
error: building json-c:x64-windows failed with: BUILD_FAILED
Elapsed time to handle json-c:x64-windows: 2.2 s
read_contents("b�#erl�E-SafeNetLOCK"): invalid argument
C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-out.log as follows:
---------------==----------------
[1/2] "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" -E chdir ".." "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" "C:/vcpkgsrc/vcpkg/buildtrees/json-c/src/a22988fb34-2c10eba8ac.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/vcpkgsrc/vcpkg/packages/json-c_x64-windows" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DBUILD_TESTING=OFF" "-DBUILD_STATIC_LIBS=0" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_MAKE_PROGRAM=D:/visualStudio/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/vcpkgsrc/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-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=C:/vcpkgsrc/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=C:/vcpkgsrc/vcpkg" "-D_VCPKG_INSTALLED_DIR=C:/vcpkgsrc/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
FAILED: ../CMakeCache.txt
"C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" -E chdir ".." "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" "C:/vcpkgsrc/vcpkg/buildtrees/json-c/src/a22988fb34-2c10eba8ac.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/vcpkgsrc/vcpkg/packages/json-c_x64-windows" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DBUILD_TESTING=OFF" "-DBUILD_STATIC_LIBS=0" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_MAKE_PROGRAM=D:/visualStudio/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/vcpkgsrc/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v143" "-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=C:/vcpkgsrc/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=C:/vcpkgsrc/vcpkg" "-D_VCPKG_INSTALLED_DIR=C:/vcpkgsrc/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
-- The C compiler identification is MSVC 19.40.33811.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: D:/visualStudio/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: D:/visualStudio/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
is not able to compile a simple test program.
It fails with the following output:
---------------------==--------------------
I have already installed the following requirements:
Visual Studio Desktop development with C++.
Windows 10 SDK or Windows 11 SDK.
and when I tested the hello world demo using cmake, there was no problem. This is the successful output of my hello world. success log:
PS C:\vcpkgsrc\test\build> cmake ..
-- Building for: Visual Studio 17 2022
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.32.31342.0
-- The CXX compiler identification is MSVC 19.32.31342.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/visualStudio/VC/Tools/MSVC/14.32.31326/bin/HostX64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/visualStudio/VC/Tools/MSVC/14.32.31326/bin/HostX64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (10.8s)
-- Generating done (0.0s)
-- Build files have been written to: C:/vcpkgsrc/test/build
What should I do to fix vcpkg install error?Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions