Re: [cmake-developers] CMake build with static crt and static QtDialog not linking
I had a project where I had to do this in the main.cpp file to get it to link with static Qt on Windows: #ifdef _WIN32 #ifdef QT_STATIC Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) #endif #endif Those unresolved externals you posted look familiar... Does this fix it? HTH, David C. On Tue, Feb 13, 2018 at 11:28 AM, Stuermer, Michael SP/HZA-ZSEPwrote: > I try to do a CMake build with static C runtime and a static Qt 5.10.0 build > to avoid runtime errors when giving the binaries to colleagues. The Visual > Studio version is 2017. AFAIK the official CMake builds already use this > “full-static-build” scheme. However I end up with some linking errors of 137 > unresolved external symbols starting with > > > > unresolved external symbol __imp_OpenThemeData referenced in function > "public: virtual void __cdecl QVistaBackButton::paintEvent > > > > and ending with > > > > unresolved external symbol NetApiBufferFree referenced in function "public: > static bool __cdecl QFileSystemEngine::uncListSharesOnServer > > > > Are there some tricks I have to do to get this working? I changed all /MD > flags manually to /MT, but nothing else so far. > > > > PS: I’m not sure how the mailing list is handled compared to the gitlab > instance. Would this be something I should open an issue for? I personally > do not see it as an issue (which means “something has to be changed in the > code” for me). Or is the mailing list more or less a leftover from > before-gitlab times? > > > > Best regards, > > Michael > > > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > https://cmake.org/mailman/listinfo/cmake-developers > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers
Re: [cmake-developers] CMake build with static crt and static QtDialog not linking
On 2/13/2018 11:28 AM, Stuermer, Michael SP/HZA-ZSEP wrote: > I try to do a CMake build with static C runtime and a static Qt 5.10.0 Make sure Qt is configured with both `-static` and `-static-runtime`, and that it is built with the same compiler as CMake. See the command used below to configure the 64-bit Qt build for the cmake.org binaries. We use Qt 5.6.3 because it is the last to support Windows XP. Also, Qt 5.6 doesn't quite set up it's CMake targets correctly when doing a static build. I had to hack lib/cmake/Qt5Core/Qt5CoreConfig.cmake: set(_Qt5Core_LIB_DEPENDENCIES "${_qt5Core_install_prefix}/lib/qtpcre.lib") > PS: I’m not sure how the mailing list is handled compared to the gitlab > instance. Would this be something I should open an issue for? The mailing list is fine for this. -Brad ``` call ..\qt-everywhere-opensource-src-5.6.3\configure.bat ^ -prefix c:/path/to/prefix ^ -static ^ -static-runtime ^ -release ^ -opensource -confirm-license ^ -platform win32-msvc2017 ^ -mp ^ -gui ^ -widgets ^ -qt-pcre ^ -qt-zlib ^ -qt-libpng ^ -qt-libjpeg ^ -no-gif ^ -no-icu ^ -no-pch ^ -no-sql-sqlite ^ -no-cetest ^ -no-angle ^ -no-opengl ^ -no-dbus ^ -no-qml-debug ^ -no-harfbuzz ^ -no-accessibility ^ -skip declarative ^ -skip multimedia ^ -skip qtcanvas3d ^ -skip qtconnectivity ^ -skip qtdeclarative ^ -skip qtlocation ^ -skip qtmultimedia ^ -skip qtsensors ^ -skip qtserialport ^ -skip qtsvg ^ -skip qtwayland ^ -skip qtwebchannel ^ -skip qtwebengine ^ -skip qtwebsockets ^ -skip qtwinextras ^ -skip qtxmlpatterns ^ -nomake examples -nomake tests ``` -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers
[cmake-developers] CMake build with static crt and static QtDialog not linking
I try to do a CMake build with static C runtime and a static Qt 5.10.0 build to avoid runtime errors when giving the binaries to colleagues. The Visual Studio version is 2017. AFAIK the official CMake builds already use this "full-static-build" scheme. However I end up with some linking errors of 137 unresolved external symbols starting with unresolved external symbol __imp_OpenThemeData referenced in function "public: virtual void __cdecl QVistaBackButton::paintEvent and ending with unresolved external symbol NetApiBufferFree referenced in function "public: static bool __cdecl QFileSystemEngine::uncListSharesOnServer Are there some tricks I have to do to get this working? I changed all /MD flags manually to /MT, but nothing else so far. PS: I'm not sure how the mailing list is handled compared to the gitlab instance. Would this be something I should open an issue for? I personally do not see it as an issue (which means "something has to be changed in the code" for me). Or is the mailing list more or less a leftover from before-gitlab times? Best regards, Michael -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake-developers