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
1. create directory for the plugin under the solution directory and move ,pro file to it (use your own name rather than jury)TEMPLATE = lib
TARGET = juryplugin
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += juryinterface.h juryplugin.h
SOURCES += juryplugin.cpp
CONFIG += plugin static
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
5. add dependency in solution so that plugin builds before app#include <QtPlugin>
#include "..\(plugindirectory)\(plugin)interfaqce.h
QT_IMPORT_PLUGIN((plugin)interface)
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
Bookmarks