Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Application Plugins

    General and Desktop
    2
    3
    1177
    Loading More Posts
    • 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.
    • G
      GrahamL last edited by

      Hi
      I am developing a set of plugins for my Qt application using VS 2012
      When I created the project I selected Qt Library as the project type, but when I load the library with QPluginLoader the 'instance' method failed.
      I then created another VS project using the 'Qt Application' as the project type and deleted main.cpp and using the VS properties manager I set the configuration type to Dynamic library, Using this method the plugin is loaded and behaves as expected.
      I have compared the VS configuration properties and they are identical.
      I have created a .pro file for both projects using VS and they are also identical.

      I would be grateful if anyone could tell me the reason for this

      Thanks

      1 Reply Last reply Reply Quote 0
      • A
        andreyc last edited by

        When you the plugin do you get shared library?
        Could you show part of .pro files with QT, CONFIG, TEMPLATE, and TARGET variables.

        When I created a plugin using qtcreator I've got .pro file
        @
        ...
        QT += widgets network
        QT -= gui

        CONFIG += plugin debug

        TARGET = $$qtLibraryTarget(my_plugin)
        TEMPLATE = lib
        ...
        @

        1 Reply Last reply Reply Quote 0
        • G
          GrahamL last edited by

          Hi
          This is the .pro file for plugin created in VS as a Qt Library
          @

          ----------------------------------------------------

          This file is generated by the Qt Visual Studio Add-in.

          ------------------------------------------------------

          TEMPLATE = lib
          TARGET = DockedWidget1Plugin
          DESTDIR = ../plugins
          QT += core widgets gui
          CONFIG += debug console
          DEFINES += WIN64 QT_DLL QT_WIDGETS_LIB DOCKEDWIDGET1PLUGIN_LIB
          INCLUDEPATH += ../../DockedWidgets
          ../../../../../Acq++/CommonUI/ApplicationCode/Plugins
          ../../../../../Acq++/CommonQt/ApplicationCode/SystemLogging
          ../../../../../Acq++/Global
          ../../../../../Acq++/CommonUI/ApplicationCode/Preferences
          ../../../InterfaceFactoriesApplication/InterfaceFactoriesApplication
          ./Build/ui
          .
          ./Build/moc
          LIBS += -L"../../DockedWidgets/Build/Debug"
          -L"../../../../../Acq++/bin"
          -lDockedWidgetsd
          -lCommonQtd
          -lASLCommonUId
          DEPENDPATH += .
          MOC_DIR += ./Build/moc
          OBJECTS_DIR += debug
          UI_DIR += ./Build/ui
          RCC_DIR += ./Build/rcc
          HEADERS += ./DockedWidget1Plugin.h
          ./DockedWidget1PluginFactory.h
          SOURCES += ./DockedWidget1Plugin.cpp
          ./DockedWidget1PluginFactory.cpp
          @

          and this is the .pro file produced for VS when the project was created as a Qt Application
          @

          ----------------------------------------------------

          This file is generated by the Qt Visual Studio Add-in.

          ------------------------------------------------------

          TEMPLATE = lib
          TARGET = DockedWidget2Plugin
          DESTDIR = ../plugins
          QT += core widgets gui
          CONFIG += debug
          DEFINES += WIN64 QT_DLL QT_WIDGETS_LIB
          INCLUDEPATH += ../../../../../Acq++/CommonUI/ApplicationCode/Plugins
          ../../../../../Acq++/CommonQt/ApplicationCode/SystemLogging
          ../../../../../Acq++/Global
          ../../../../../Acq++/CommonUI/ApplicationCode/Preferences
          ../../../InterfaceFactoriesApplication/InterfaceFactoriesApplication
          ./Build/ui
          .
          ./Build/moc
          LIBS += -L"../../../../../Acq++/bin"
          -lCommonQtd
          -lASLCommonUId
          DEPENDPATH += .
          MOC_DIR += ./Build/moc
          OBJECTS_DIR += debug
          UI_DIR += ./Build/ui
          RCC_DIR += ./Build/rcc
          HEADERS += ./DockedWidget2Plugin.h
          ./DockedWidget2PluginFactory.h
          SOURCES += ./DockedWidget2Plugin.cpp
          ./DockedWidget2PluginFactory.cpp
          @

          1 Reply Last reply Reply Quote 0
          • First post
            Last post