microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.41k stars 6.2k forks source link

[json-c] vcpkg install json-c build failure #39181

Open ChiehWang123 opened 1 month ago

ChiehWang123 commented 1 month ago

Operating system

Windows

Compiler

MSVC

Steps to reproduce the behavior

vcpkg install json-c (jsoncpp, otheers like this)

Failure logs

[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

Additional context

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!

ChiehWang123 commented 1 month ago

PS 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#erlE-SafeNetLOCK"): invalid argument

ChiehWang123 commented 1 month ago

os Windows 10 x64 SDK: image

ChiehWang123 commented 1 month ago

image

jimwang118 commented 1 month ago

Please provide the error log. C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-out.log

ChiehWang123 commented 1 month ago

Failure logs is the C:\vcpkgsrc\vcpkg\buildtrees\json-c\config-x64-windows-out.log Thanks!

ChiehWang123 commented 1 month ago

This is the error log for installing zlib, which is the same as json-c:

[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/zlib/src/v1.3.1-2e5db616bf.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/vcpkgsrc/vcpkg/packages/zlib_x64-windows" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DSKIP_INSTALL_FILES=ON" "-DZLIB_BUILD_EXAMPLES=OFF" "-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/zlib/src/v1.3.1-2e5db616bf.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=C:/vcpkgsrc/vcpkg/packages/zlib_x64-windows" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DSKIP_INSTALL_FILES=ON" "-DZLIB_BUILD_EXAMPLES=OFF" "-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

"D:/visualStudio/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/vcpkgsrc/vcpkg/buildtrees/zlib/x64-windows-rel/CMakeFiles/CMakeScratch/TryCompile-mat5v0'

Run Build Command(s): D:/visualStudio/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe -v cmTC_28788
[1/2] D:\visualStudio\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe  /nologo   /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP   /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -MDd /showIncludes /FoCMakeFiles\cmTC_28788.dir\testCCompiler.c.obj /FdCMakeFiles\cmTC_28788.dir\ /FS -c C:\vcpkgsrc\vcpkg\buildtrees\zlib\x64-windows-rel\CMakeFiles\CMakeScratch\TryCompile-mat5v0\testCCompiler.c
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\vcpkgsrc\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_28788.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- D:\visualStudio\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_28788.dir\testCCompiler.c.obj  /out:cmTC_28788.exe /implib:cmTC_28788.lib /pdb:cmTC_28788.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: cmTC_28788.exe 
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\vcpkgsrc\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_28788.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- D:\visualStudio\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_28788.dir\testCCompiler.c.obj  /out:cmTC_28788.exe /implib:cmTC_28788.lib /pdb:cmTC_28788.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /fo CMakeFiles\cmTC_28788.dir/manifest.res CMakeFiles\cmTC_28788.dir/manifest.rc" failed (exit code 0) with the following output:
no such file or directory
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:4 (project)

-- Configuring incomplete, errors occurred! [2/2] "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" -E chdir "../../x64-windows-dbg" "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" "C:/vcpkgsrc/vcpkg/buildtrees/zlib/src/v1.3.1-2e5db616bf.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=C:/vcpkgsrc/vcpkg/packages/zlib_x64-windows/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DSKIP_INSTALL_FILES=ON" "-DZLIB_BUILD_EXAMPLES=OFF" "-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" "-DSKIP_INSTALL_HEADERS=ON" FAILED: ../../x64-windows-dbg/CMakeCache.txt "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" -E chdir "../../x64-windows-dbg" "C:/vcpkgsrc/vcpkg/downloads/tools/cmake-3.29.2-windows/cmake-3.29.2-windows-i386/bin/cmake.exe" "C:/vcpkgsrc/vcpkg/buildtrees/zlib/src/v1.3.1-2e5db616bf.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=C:/vcpkgsrc/vcpkg/packages/zlib_x64-windows/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DSKIP_INSTALL_FILES=ON" "-DZLIB_BUILD_EXAMPLES=OFF" "-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" "-DSKIP_INSTALL_HEADERS=ON" -- 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

"D:/visualStudio/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/vcpkgsrc/vcpkg/buildtrees/zlib/x64-windows-dbg/CMakeFiles/CMakeScratch/TryCompile-r28ui7'

Run Build Command(s): D:/visualStudio/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe -v cmTC_e56b9
[1/2] D:\visualStudio\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe  /nologo   /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP   /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -MDd /showIncludes /FoCMakeFiles\cmTC_e56b9.dir\testCCompiler.c.obj /FdCMakeFiles\cmTC_e56b9.dir\ /FS -c C:\vcpkgsrc\vcpkg\buildtrees\zlib\x64-windows-dbg\CMakeFiles\CMakeScratch\TryCompile-r28ui7\testCCompiler.c
[2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\vcpkgsrc\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_e56b9.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- D:\visualStudio\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_e56b9.dir\testCCompiler.c.obj  /out:cmTC_e56b9.exe /implib:cmTC_e56b9.lib /pdb:cmTC_e56b9.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: cmTC_e56b9.exe 
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\vcpkgsrc\vcpkg\downloads\tools\cmake-3.29.2-windows\cmake-3.29.2-windows-i386\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_e56b9.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- D:\visualStudio\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_e56b9.dir\testCCompiler.c.obj  /out:cmTC_e56b9.exe /implib:cmTC_e56b9.lib /pdb:cmTC_e56b9.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."

RC Pass 1: command "rc /fo CMakeFiles\cmTC_e56b9.dir/manifest.res CMakeFiles\cmTC_e56b9.dir/manifest.rc" failed (exit code 0) with the following output:

no such file or directory

ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:4 (project)

-- Configuring incomplete, errors occurred! ninja: build stopped: subcommand failed.

jimwang118 commented 1 month ago

Please install the English language pack in VS.

ChiehWang123 commented 1 month ago

Please install the English language pack in VS.

Already install...

ChiehWang123 commented 1 month ago

Please install the English language pack in VS.

Already install...

Please install the English language pack in VS.

Installed but still reporting the same error, how should I configure it? Is there anything I need to pay attention to when using the terminal

jimwang118 commented 1 month ago

This error typically occurs when CMake attempts to compile a simple test program to verify that the compiler is working correctly. The solution varies depending on the situation. Here are some possible steps:

  1. Run as Administrator: Make sure you run CMake with administrator privileges. Sometimes, permission issues can prevent the compiler from working properly.

  2. Check Compiler Path: Confirm that CMake is using the correct compiler path. The path you provided is D:/visualStudio/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe. Ensure that this is a valid compiler path.

  3. Verify Compiler Configuration: If you're using the Visual Studio compiler, try the following steps:

    • Locate cl.exe in the Visual Studio installation directory.
    • Right-click on cl.exe and select "Properties."
    • In the "Compatibility" tab, check "Run this program as an administrator."
    • Re-run CMake.
  4. Check Environment Variables: Ensure that the system's environment variables include the correct compiler path. If not, add the compiler path to the PATH environment variable.

dg0yt commented 1 month ago
  1. Run as Administrator: Make sure you run CMake with administrator privileges. Sometimes, permission issues can prevent the compiler from working properly.

AFAICT "sometimes running as Administrator" is a cause for things not working properly, not the solution. Because it can create permissions which exclude non-privileged users.

--mt=CMAKE_MT-NOTFOUND --manifests

Is mt something which is needed at this point?

dg0yt commented 1 month ago

And it is not related to json-c, so the title was edited unnecessarily...

ChiehWang123 commented 1 month ago
  1. Run as Administrator: Make sure you run CMake with administrator privileges. Sometimes, permission issues can prevent the compiler from working properly.

AFAICT "sometimes running as Administrator" is a cause for things not working properly, not the solution. Because it can create permissions which exclude non-privileged users.

--mt=CMAKE_MT-NOTFOUND --manifests

Is mt something which is needed at this point?

I tried the above steps, but still couldn't work. I have rebuilt a compilation and running environment on the virtual machine, and there are no errors now. Please close it. Thanks!

PfunnyGuy commented 1 month ago

This shouldn't be closed. I have been fighting this for 4 days. I have found others with the same issue all over the place. Zero solutions.

github-actions[bot] commented 3 days ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.