Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.9.0
-
None
-
VS2017 Qt5.9.0_x64
Description
使用VS2017编译的Qt5.9.0_x64静态库.
当应用链接Qt5.9.0_x64静态库的Debug版本时,能够正常链接.但是无法运行.
当链接Qt5.9.0_x64静态库的Release版本时,能够正常链接,能够正常运行.
使用VS2017编译Qt5.9.0_x64_static 库的配置参数为: -prefix d:\Qt\Qt5.9.0_x64_static_msvc2017 -opensource -debug-and-release -static -opengl dynamic -nomake examples -sql-sqlite -mp 使用CMake3.8.0与VS2017编译Qt应用的CMakeList.txt文件内容为: cmake_minimum_required(VERSION 3.0.0) set(CMAKE_PREFIX_PATH D:/Qt/Qt5.9.0_x64_static_msvc2017) set(CMAKE_CXX_STANDARD 11) project(qt590static_test) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets) set(QLIBDIR "D:/Qt/Qt5.9.0_x64_static_msvc2017/lib/") set(QPLADIR "D:/Qt/Qt5.9.0_x64_static_msvc2017/plugins/platforms/") if(CMAKE_BUILD_TYPE STREQUAL Debug) set(QLIBS ${QLIBDIR}Qt5PlatformCompositorSupportd.lib ${QLIBDIR}Qt5FontDatabaseSupportd.lib ${QLIBDIR}Qt5ThemeSupportd.lib ${QLIBDIR}Qt5AccessibilitySupportd.lib ${QLIBDIR}Qt5EventDispatcherSupportd.lib ${QLIBDIR}qtlibpngd.lib ${QLIBDIR}qtfreetyped.lib ${QLIBDIR}qtpcre2d.lib ${QLIBDIR}qtharfbuzzd.lib ${QPLADIR}qminimald.lib ${QPLADIR}qoffscreend.lib ${QPLADIR}qwindowsd.lib ${QPLADIR}qdirect2dd.lib ) elseif(CMAKE_BUILD_TYPE STREQUAL Release) set(QLIBS ${QLIBDIR}Qt5PlatformCompositorSupport.lib ${QLIBDIR}Qt5FontDatabaseSupport.lib ${QLIBDIR}Qt5ThemeSupport.lib ${QLIBDIR}Qt5AccessibilitySupport.lib ${QLIBDIR}Qt5EventDispatcherSupport.lib ${QLIBDIR}qtlibpng.lib ${QLIBDIR}qtfreetype.lib ${QLIBDIR}qtpcre2.lib ${QLIBDIR}qtharfbuzz.lib ${QPLADIR}qminimal.lib ${QPLADIR}qoffscreen.lib ${QPLADIR}qwindows.lib ${QPLADIR}qdirect2d.lib ) else(CMAKE_BUILD_TYPE STREQUAL Debug) message(FATAL_ERROR "please set CMAKE_BUILD_TYPE = Debug | Release") endif(CMAKE_BUILD_TYPE STREQUAL Debug) qt5_wrap_ui(ui_qt590static_test.h qt590static_test.ui) add_executable(qt590static_test WIN32 main.cpp qt590static_test.cpp qt590static_test.ui) target_link_libraries( qt590static_test Qt5::Widgets ${QLIBS} imm32.lib winmm.lib Dwmapi.lib UxTheme.lib Mincore.lib version.lib ws2_32.lib )