Change Standalone Qt App into Plugin for VS Project
Using Visual Studio 2008 with the Qt VS add-in, I built a standalone Qt application. Now I want to change its build so another VS project can use it as a plug-in.
- //ExportMe.h
- #define EXPORT_THIS Q_DECL_EXPORT
- Q_OBJECT
- public:
- ~MyConstructor();
- };
- //ExportMe.cpp
- #include "ExportMe.h"
- extern "C" {
- ui.setupUi(this);
- }
- ExportMe::~MyConstructor() {}
- }
- //main.cpp
- #include "ExportMe.h"
- #include <QtGui/QApplication>
- int main(int argc, char *argv[]) {
- ExportMe e;
- e.show();
- return a.exec();
- }
—————————————————————-
New Project
—————————————————————-
- //IntegratedProj.cpp
- #include "ExportMe.h"
- ExportMe::MyConstructor(parent, flags);
- }
—————————————————————-
The Problem
—————————————————————-
The combined project does not run the plug-in. I have tried the following:
1) Left the Project Properties the same for both projects, only adding Linker dependencies to IntegratedProj. This produced ExportMe.lib and ExportMe.exe. When I run depends.exe on IntegratedProj.exe, it requires the ExportMe.exe to be in the same directory. This allowed the IntegratedProj to recognize the plug-in, but it did not display the form file (UI). Prefer if final solution does not require adding the ExportMe executable to the IntegratedProj directory (prefer to share a dll).
2) Changed the Project Properties for ExportMe project so it’s General Configuration Type was set to .dll and the Linker Output File was set to .dll. This fails to compile due to Linker error (it cannot find the ExportMe.lib file). This Build configuration does not create a lib file though.
How can I modify my solution, either in code or Build Properties, to turn the standalone Qt application into a plug-in for a Visual Studio project?
1 reply
You must log in to post a reply. Not a member yet? Register here!


