MINGW-packages: [qt6-static] CMake can not locate harfbuzz in an empty Hello-world widgets application.
Description / Steps to reproduce the issue
Greate! Qt Charts is back in static release. However, a new tiny problem breaks out after the update.
When creating a new empty hello-world QWidget application with qtcreator (CMAKE), CMake reports some error messages with IMPORTED_IMPLIB and harfbuzz::harfbuzz, like this:
Running C:\msys64\ucrt64\bin\cmake.exe -S D:/Projects/testQt6Static -B D:/Projects/build-testQt6Static-Desktop_Qt_6_6_0_static_MinGW_w64_UCRT64_MSYS2-Release "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_BUILD_TYPE:STRING=Release" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=D:\Projects\build-testQt6Static-Desktop_Qt_6_6_0_static_MinGW_w64_UCRT64_MSYS2-Release/.qtc/package-manager/auto-setup.cmake" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/msys64/ucrt64/qt6-static/bin/qmake.exe" "-DCMAKE_PREFIX_PATH:PATH=C:/msys64/ucrt64/qt6-static" "-DCMAKE_C_COMPILER:FILEPATH=C:/msys64/ucrt64/bin/gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/msys64/ucrt64/bin/g++.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=" in D:\Projects\build-testQt6Static-Desktop_Qt_6_6_0_static_MinGW_w64_UCRT64_MSYS2-Release.
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/ucrt64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: C:/msys64/ucrt64/lib/libz.dll.a (found version "1.3")
-- Found WrapSystemZLIB: TRUE
-- Using system ZLIB.
-- Found WrapZLIB: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Checking for module 'libb2'
-- Found libb2, version 0.98.1
-- Found WrapSystemPCRE2: C:/msys64/ucrt64/lib/libpcre2-16.dll.a (found version "10.42")
-- Using system PCRE2.
-- Found WrapPCRE2: TRUE
-- Performing Test HAVE_GETTIME
-- Performing Test HAVE_GETTIME - Success
-- Performing Test HAVE_SHM_OPEN_SHM_UNLINK
-- Performing Test HAVE_SHM_OPEN_SHM_UNLINK - Failed
-- Found WrapRt: TRUE
-- Found WrapSystemPNG: C:/msys64/ucrt64/lib/libpng.dll.a;C:/msys64/ucrt64/lib/libz.dll.a (found version "1.6.40")
-- Using system PNG.
-- Found WrapPNG: TRUE
-- Found WrapSystemHarfbuzz: TRUE
-- Using system Harfbuzz.
-- Found WrapHarfbuzz: TRUE
-- Found WrapSystemFreetype: C:/msys64/ucrt64/lib/libfreetype.dll.a (found version "2.13.2")
-- Using system Freetype.
-- Found WrapFreetype: TRUE
-- Found WrapVulkanHeaders: C:/msys64/ucrt64/include
-- Found WrapSystemJpeg: C:/msys64/ucrt64/lib/libjpeg.dll.a (found version "80")
-- Using system Jpeg.
-- Found WrapJpeg: TRUE
-- Checking for module 'libmng'
-- Found libmng, version 2.0.3
-- Found TIFF: C:/msys64/ucrt64/lib/libtiff.dll.a (found version "4.6.0")
-- Found OpenSSL: C:/msys64/ucrt64/lib/libcrypto.dll.a (found version "3.1.4")
-- Found WrapOpenSSLHeaders: C:/msys64/ucrt64/include (found version "3.1.4")
-- Found WrapOpenSSL: C:/msys64/ucrt64/lib/libcrypto.dll.a (found version "3.1.4")
-- Checking for module 'libwebp'
-- Found libwebp, version 1.3.2
-- Checking for module 'libwebpdemux'
-- Found libwebpdemux, version 1.3.2
-- Checking for module 'libwebpmux'
-- Found libwebpmux, version 1.3.2
-- Found WrapWebP: C:/msys64/ucrt64/include
-- Configuring done (6.9s)
CMake Error in CMakeLists.txt:
IMPORTED_IMPLIB not set for imported target "harfbuzz::harfbuzz"
configuration "Release".
-- Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.
CMake process exited with exit code 1.
Elapsed time: 00:07.
May be some lib config for harfbuzz is missing in Qt’s CMake config files.
The problem only exist in widgets apps, console app is good.
Expected behavior
May tell CMake about the path for harfbuzz libs.
Actual behavior
Thanks a lot!
Verification
- I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)
Windows Version
MINGW64_NT-10.0-22621
MINGW environments affected
- MINGW64
- MINGW32
- UCRT64
- CLANG64
- CLANG32
- CLANGARM64
Are you willing to submit a PR?
No response
About this issue
- Original URL
- State: open
- Created 8 months ago
- Reactions: 1
- Comments: 21 (3 by maintainers)
static libraries has
.a
extension. I said it before.dll.a
is an import library, Do your research aboutWhat is an import library on Windows
.No, you should fix qt6-static to pick static libraries instead of shared ones at CMake configuration time and make sure that no qt6-static library was linked against any shared library except the runtime ones. That requires a huge work that could need days to complete.
for QMAKE App extra link libraries should be involved:
QMAKE_LIBS += -ltiff -lmng.dll -ljpeg -ljbig -ldeflate -lzstd -llerc -llzma -lgraphite2 -lbz2 -lusp10 -lRpcrt4 -lsharpyuv
Then It’s OK! I’ll then focus in CMake projetcs and find out how we can slove this problem and succeed in building.