Found something:
After undefining XPAF_DLL_EXPORT the unresolved externals went away...
Is there a difference in Qt4? I think I read somewhere that the moc now understands macro expantions....![]()
Found something:
After undefining XPAF_DLL_EXPORT the unresolved externals went away...
Is there a difference in Qt4? I think I read somewhere that the moc now understands macro expantions....![]()
Derick Schoonbee
Does that class of yours inherit QObject?
Yes they do.
When I build the DLL my classes are not exported. I even tried to export my classes with:
# define XPAF_DLL_EXPORT Q_DECL_EXPORT
and
# define XPAF_DLL_EXPORT __declspec(dllexport)
Anything that I should try with QT4?
Derick Schoonbee
Does anybody have some sample classes exported in external DLLs? Please
My code compiles but I get an error as my DLL does not show the exported classes. Or do we need to load DEF files?
Derick Schoonbee
Check Qt4 sources![]()
Maybe a more specific hint.. I only found some specific macros for plugins.
Derick Schoonbee
I even tried:
Qt Code:
#include <QtCore/qglobal.h> // Win 32 DLL export macros #ifdef WIN32 # ifdef BUILD_DLL //# define XPAF_DLL_EXPORT __declspec(dllexport) # define XPAF_DLL_EXPORT Q_DECL_EXPORT # else # define XPAF_DLL_EXPORT // Empty # endif #endif // WIN32To copy to clipboard, switch view to plain text mode
Derick Schoonbee
Are you sure you pinpointed the problem correctly? It looks like your plugin can't resolve a symbol. I know it shouldn't even try to, but... It looks like an overall compiler issue not a Qt one. Try to build any plugin which needs an external dependency (for example one that needs a "foo()" function. When you succeed, you'll come back to Qt. Maybe you lack some compiler option?
Hmmm... after using:
Qt Code:
#include <QtCore/qglobal.h> # define XPAF_DLL_EXPORT Q_DECL_EXPORTTo copy to clipboard, switch view to plain text mode
And the rebuild of the whole planet... one DLL worked ....phew....
Now to sort out the other...
It still is the same unresolved symbols so I'll check some defines...
Derick Schoonbee
Sigh ... still no joy...
When creating a 2nd DLL the imports of the 1st does not work:
Qt Code:
ezGScreenInterface.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const ezCrm::ezBase::staticMetaObject" (?staticMetaObject@ezBase@ezCrm@@2UQMetaObject@@B)To copy to clipboard, switch view to plain text mode
ezGScreenInterfac declated in 2nd DLL
ezBase declared in 1st DLL
Any idea why teh meta object does not get exported in the 1st DLL?
Derick Schoonbee
When you compile code that will use your DLL (not the DLL itself), you need __declspec(dllimport) (in the same place where __declspec(dllexport) was).Originally Posted by derick
I sorry, I am having a problem very similar to this, but when reading this thread I keep thinking, shouldn't Qt be abstracting all this?
Where in the Qt documentation does it say I need to have "dllexport", "dllimport" declarations everywhere?
Bookmarks