Results 1 to 3 of 3

Thread: Qt Static Plugin

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt Static Plugin

    Yes, the problem is with the linking of the library, but occurs in the compiler settings. With the help of Qt support, the problem was resolved by using a .pro file to create the plugin. The Qt menu on Visual Studio has "Open Qt Project File (.pro)" which can create a VS project with the correct includes and pre-processor settings. I had tried to use the QLibrary template and add the proper settings, but failed to get them all, especially QT_STATICPLUGIN and several includes. The Visual Studio Addin does not have a template that will do this. I also found the build to be somewhat sensitive to the order of things, so I have listed them here. (Perhaps this is over kill, but, if it solves the problem for someone else, well worth it. Please note, I quit when it worked, so maybe there are other ways to get the same result.)

    juryplugin.pro
    TEMPLATE = lib
    TARGET = juryplugin
    DEPENDPATH += .
    INCLUDEPATH += .

    # Input
    HEADERS += juryinterface.h juryplugin.h
    SOURCES += juryplugin.cpp
    CONFIG += plugin static
    1. create directory for the plugin under the solution directory and move ,pro file to it (use your own name rather than jury)
    2. build interface and plugin files in this directory
    3. build plugin, that is, compile (just plugin)
    4. modify main.cpp in the application to add
    #include <QtPlugin>
    #include "..\(plugindirectory)\(plugin)interfaqce.h
    QT_IMPORT_PLUGIN((plugin)interface)
    5. add dependency in solution so that plugin builds before app
    6. in application properties, add library directory to "additional library directories", note this has to be done for both debug and release
    7. in application properties, add (plugin).lib to "additional Libraries), again to both compiles
    8. build it all
    Last edited by johnmauer; 6th February 2010 at 12:56. Reason: typo

Similar Threads

  1. Extending a plugin in a static library
    By ultim8 in forum Qt Programming
    Replies: 5
    Last Post: 25th March 2010, 15:10
  2. Static vs Plugin
    By treyhaslem in forum Newbie
    Replies: 5
    Last Post: 4th December 2009, 14:16
  3. How to use static mysql plugin
    By khikho in forum Qt Programming
    Replies: 7
    Last Post: 19th January 2009, 21:44
  4. Link problems with static MySQL plugin
    By nurtsi in forum Installation and Deployment
    Replies: 4
    Last Post: 20th September 2007, 15:32
  5. Replies: 19
    Last Post: 20th September 2007, 11:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.