Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWindows static linking (Qt Plugin)
Forum Updated to NodeBB v4.3 + New Features

QWindows static linking (Qt Plugin)

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 128 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DmitriyBobrov
    wrote on last edited by
    #1

    I have a driver .dll on c++. It uses Qt::Gui, Network, Core and Widgets. Now there are shared. I could make them static and linked them to .dll statically by building with conan package manager with "qt:shared=False". But in result folder (after installing our product) there is "platforms" folder and qwindows.dll in them that is also used by .dll. I need link it statically too. If I tempoparily delete qwindows.dll, I get:

    fba66294-2823-4347-bcbd-d391def8e671-image.png

    A code in Cmakelists.txt like find_library (LIB qwindows.lib PATH/TO/LIB) and then target_link_libraries (.... LIB) doesn't work.

    I provide some cmakelists:

    Root cmakelists (some interesting strings):

    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -Wall -Wextra -Waddress -Wpedantic -Wfatal-errors")
    if(${FC_CI_BUILD} STREQUAL "OFF")
        set(Qt5_DIR ${CONAN_QT_ROOT})
        set(sentry_DIR ${CONAN_SENTRY-NATIVE_ROOT})
        list(APPEND CMAKE_FIND_ROOT_PATH
            ${Qt5_DIR}
            ${CONAN_CAF_ROOT}
            ${CONAN_PROTOBUF_ROOT}
            ${CONAN_FRUIT_ROOT}
            ${CONAN_OPENSSL_ROOT}
            ${CONAN_BOOST_ROOT}
        )
        set(Boost_USE_STATIC_LIBS ON)
    endif()
    find_package(Qt5 COMPONENTS Core Network Widgets Gui REQUIRED)
    

    Driver target

    project(driver VERSION ${FC_DRIVER_VERSION})
    include_directories(${PROJECT_BINARY_BIN})
    set(QT_UI_DRV
            driver/ui/properties.ui
            driver/ui/kkt_settings.ui
            driver/ui/about.ui
            driver/ui/add_picture_in_cliche.ui
    )
    set(QT_HDRS_DRV
            driver/ui/properties.h
            driver/ui/kkt_settings.h
            driver/ui/about.h
            driver/ui/add_picture_in_cliche.h
    )
    set(QT_DRV_RCC
            driver/ui/driver.qrc
            driver/duktape/scripts/driver_scripts.qrc
    )
    if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL Android)
            find_package(Qt5 COMPONENTS Widgets Gui REQUIRED)
            include(FiscalCoreQt5Widgets)
            fc_qt5_wrap_ui(QT_UI_DRV_WRAPPED ${QT_UI_DRV} FOLDER driver/ui)
            qt5_wrap_cpp(QT_SRCS_DRV_WRAPPED ${QT_HDRS_DRV})
    endif()
    qt5_add_resources(QT_DRV_RCC_WRAPPED ${QT_DRV_RCC})
    
    set(DRIVER_SRCS
            *.cpp
            ${QT_UI_DRV_WRAPPED}
            ${QT_SRCS_DRV_WRAPPED}
            ${QT_DRV_RCC_WRAPPED}
    )
    list(APPEND FISCAL_CORE_DRIVER_SRCS
                    driver/ui/properties.cpp
                    driver/ui/kkt_settings.cpp
                    driver/ui/about.cpp
                    driver/ui/add_picture_in_cliche.cpp
                    ${QT_HDRS_DRV}
                    standard_path_windows.cpp
            )
    add_library(${PROJECT_NAME} SHARED ${FISCAL_CORE_DRIVER_SRCS})
    
    set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
    target_compile_definitions(${PROJECT_NAME} PUBLIC SPDLOG_WCHAR_FILENAMES)
    
    set(FISCAL_CORE_DRIVER_DEPS
            Qt5::Core
            Qt5::Network
            Qt5::Gui
            Qt5::Widgets
            ${FRUIT_LIBRARY}
            ${CAF_LIBRARIES}
            ${Protobuf_LIBRARIES}
            ${CAF_EXTRA_LDFLAGS}
            Boost::filesystem
            Boost::fiber
            Boost::locale
            duktape
            ${PNG_LIBRARIES}
    )
    
    target_link_libraries(${PROJECT_NAME} PRIVATE ${FISCAL_CORE_DRIVER_DEPS})
    

    I've tried:

    Added Qt5::QWindowsIntegrationPlugin
    find_library (qwindows.lib) as mentioned above

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved