Originally Posted by
wysota
Did you export the symbols in the library correctly? When building the library the symbol should be declared as dllexport and when using it - as dllimport.
I have the following in my library:
#if defined(TESTLIB_LIBRARY)
#define TESTLIB_EXPORT Q_DECL_EXPORT
#else
#define TESTLIB_EXPORT Q_DECL_IMPORT
#endif
#if defined(TESTLIB_LIBRARY)
#define TESTLIB_EXPORT Q_DECL_EXPORT
#else
#define TESTLIB_EXPORT Q_DECL_IMPORT
#endif
To copy to clipboard, switch view to plain text mode
and
TESTLIB_EXPORT
QString testfunc
() { return "This is a test";
}
TESTLIB_EXPORT QString testfunc() { return "This is a test"; }
To copy to clipboard, switch view to plain text mode
I have a DEFINES += TESTLIB_LIBRARY in the .pro file of the library. What is strange is if I comment out the conditional compilation so that TESTLIB_EXPORT is always defined as Q_DECL_EXPORT is seems to work. This doesn't make sense, because then surely it is not being specified as dllimport in the exe
Bookmarks