[Qt-interest] Q_OBJECT in DLL - Release build warnings
Catalin Roman
katalin.roman at gmail.com
Mon Feb 8 10:49:34 CET 2010
Hello everybody,
This is my first post, so please let me know gently if this is the wrong
place to seek answers to my following problem.
I'm building a DLL using Qt 4.6 and Qt Creator 1.3.0. The main class of the
DLL has the Q_OBJECT macro declared in the .h file because I'm using
signals/slots. When I build in Release mode, I get 4 warnings concerning
staticMetaObject, metaObject(), qt_metacast() and qt_metacall() saying
"redeclared without dllimport attribute after being referenced with dll
linkage/previous dllimport ignored". To get rid of this warnings, I replaced
in the .h file the Q_OBJECT macro with the code it defines (the public
definitions of the above mentioned members) and also I pasted in the .cpp
file the implementations of these functions (taken from the corresponding
moc_*.cpp file). This workaround eliminates the original 4 warnings but
rises a new warning which was discussed in
http://lists.trolltech.com/qt-interest/2006-02/thread00382-0.html.
So, hoping that I presented fairly the context of the problem ... the
question is: Is there a better way to get rid of this compiler warnings?
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100208/f6a38750/attachment.html
More information about the Qt-interest-old
mailing list