-
Notifications
You must be signed in to change notification settings - Fork 1.2k
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linker errors with cmake and qt-static build #5010
Comments
hmm i seem to remember running into the same. |
I am also unable to build anything linking to qt5-static. It used to work in the past (around Qt 5.10 version). Reproduction steps: CMakeLists.txt cmake_minimum_required(VERSION 3.13)
project(static_qt)
set(CMAKE_PREFIX_PATH "C:/msys64/mingw32/qt5-static")
find_package(Qt5 5 REQUIRED Core)
add_executable(static_qt main.cpp)
target_link_libraries(static_qt PUBLIC Qt5::Core) main.cpp #include <QObject>
int main()
{
QObject object;
return 0;
} Result:
|
use vcpkg |
I have the same annoying problem which I haven't solved yet:
|
I know this one, because I've just run into it: the compiler has found the non static include files. On Windows these contain magic necessary to force linkage to a DLL. You'll need to use the specific pkg-config setup provided by qt-static. |
when compiling a cmake project using Modules `Quick Core Qml QuickWidgets, the static compile fails with the following linker errors
cmake command line is as follows:
cmake ../ -G Ninja "-DCMAKE_CXX_COMPILER:STRING=E:/Cpp/msys2/mingw64/bin/g++.exe" "-DCMAKE_C_COMPILER:STRING=E:/Cpp/msys2/mingw64/bin/gcc.exe" "-DCMAKE_PREFIX_PATH:STRING=E:/Cpp/msys2/mingw64/qt5-static" "-DQT_QMAKE_EXECUTABLE:STRING=E:/Cpp/msys2/mingw64/qt5-static/bin/qmake.exe"
Though qmake-static, qmake-dynamic and cmake dynamic builds works as expected
The text was updated successfully, but these errors were encountered: