Closed Erriez closed 1 month ago
You are linking to the wrong ICU:
These should not be there:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\icuin.Lib C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\icuuc.lib
These should not be there: C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\icuin.Lib C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\icuuc.lib
Thanks for your useful hint, you're right!
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\
is automatically created by installing Microsoft Visual Studio 2022 Community edition Desktop development with C++
| Windows 11 SDK
. This component is required, otherwise build errors occurs:
Removing the Windows Performance Toolkit
deletes C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\
, but cannot build libxml2 anymore:
c:\data\projects\strawberry\msvc_\build_release>cd "libxml2-v2.13.4" || goto end
c:\data\projects\strawberry\msvc_\build_release\libxml2-v2.13.4>if not exist build mkdir build || goto end
c:\data\projects\strawberry\msvc_\build_release\libxml2-v2.13.4>cmake --log-level="DEBUG" -S . -B build -G "NMake Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="c:/strawberry_msvc_x86_64_release" -DBUILD_SHARED_LIBS=ON -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=ON -DLIBXML2_WITH_LZMA=ON -DLIBXML2_WITH_ICONV=ON -DLIBXML2_WITH_ICU=ON || goto end
-- The C compiler identification is MSVC 19.41.34123.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/data/projects/strawberry/msvc_/build_release/libxml2-v2.13.4/build/CMakeFiles/CMakeScratch/TryCompile-yj85lg'
Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" -E env VERBOSE=1 nmake -f Makefile /nologo cmTC_99cde\fast
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_99cde.dir\build.make /nologo -L CMakeFiles\cmTC_99cde.dir\build
Building C object CMakeFiles/cmTC_99cde.dir/testCCompiler.c.obj
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_99cde.dir\testCCompiler.c.obj.d --working-dir=C:\data\projects\strawberry\msvc_\build_release\libxml2-v2.13.4\build\CMakeFiles\CMakeScratch\TryCompile-yj85lg --filter-prefix="Note: including file: " -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe @C:\Users\user\AppData\Local\Temp\nmB569.tmp
testCCompiler.c
Linking C executable cmTC_99cde.exe
"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_99cde.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_99cde.dir\objects1.rsp @C:\Users\user\AppData\Local\Temp\nmB5B8.tmp
Visual Studio Incremental Link with embedded manifests
Create CMakeFiles\cmTC_99cde.dir/manifest.rc
Create empty: CMakeFiles\cmTC_99cde.dir/embed.manifest
RC Pass 1:
rc /fo CMakeFiles\cmTC_99cde.dir/manifest.res CMakeFiles\cmTC_99cde.dir/manifest.rc
RC Pass 1: command "rc /fo CMakeFiles\cmTC_99cde.dir/manifest.res CMakeFiles\cmTC_99cde.dir/manifest.rc" failed (exit code 0) with the following output:
no such file or directoryNMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_99cde.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\cmTC_99cde.dir\objects1.rsp @C:\Users\user\AppData\Local\Temp\nmB5B8.tmp' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\nmake.exe" -f CMakeFiles\cmTC_99cde.dir\build.make /nologo -L CMakeFiles\cmTC_99cde.dir\build' : return code '0x2'
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:13 (project)
-- Configuring incomplete, errors occurred!
Quickest workaround is to rename the files as you mentioned, then the build and link of libxml2 is successful:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\icuin.Lib
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\icuuc.lib
I've no better workaround in mind. I assume every developer building Strawberry on a Windows (11) desktop with Visual Studio 2022 will encounter this.
Something to mention to the README.md
?
Adding -DICU_ROOT="%PREFIX_PATH_FORWARD%"
to the CMake command for libxml2 fixes this, however the safest is probably renaming the conflicting icu in Windows Kits to make sure it doesn't use any of those headers or libraries.
Thank you very much. I've tested your suggestion and solves the issue. I was already creating a PR for you, but now I see you've already fixed it. đź‘Ť
Started from Visual Studio 2022 x64 Native Tools Command Prompt on Windows 11:
C:\data\projects\strawberry\msvc_\build_release\icu
C:\data\projects\strawberry\msvc_\build_release\libxml2-v2.13.4
Any suggestion?