[Qt-interest] doubt regarding creation of shared libs in QT
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Fri May 7 11:10:02 CEST 2010
Hi All,
I'm trying to compile my prog as a shared library using the procedure
explained here:
http://doc.trolltech.com/4.6/sharedlibrary.html
It's not clear to me when/where the *_IMPORT macro should be used. The
doc mentions:
"Q_DECL_IMPORT must be added to the declarations of symbols used when
compiling a client that uses the shared library"
Now taking the same example as shown in this doc, would a client need
to add the following in its source?
MYSHAREDLIB_EXPORT void foo();
In client source this would translate to: Q_DECL_IMPORT void foo();
Is this correct?
Secondly, say in my shared library, I have a header file which just
declares an abstract class and other classes which implement the
abstract functions.
Is it needed to have MYSHAREDLIB_EXPORT macro in ALL the header files
or just having it in the abstract class's header suffice?
(since they all essentially export the same symbol, i.e the public
abstract functions).
Thanks,
-mandeep
More information about the Qt-interest-old
mailing list