PDA

View Full Version : Compiling qshortcutdialog on Windows with mingw



dvmorris
22nd April 2007, 22:31
I have been using the QShortcutManager class from edyuk on os x for quite some time now, and I am just now getting around to compiling the code on windows, and I get this error:



release\moc_qshortcutdialog.cpp:40: error: definition of static data member 'QShortcutDialog::staticMetaObject' of dllimport'd class.
release\moc_qshortcutdialog.cpp:40: warning: 'QShortcutDialog::staticMetaObject' defined locally after being referenced with dllimport linkage
mingw32-make[1]: *** [release\moc_qshortcutdialog.o] Error 1


I can't find much documentation about any error like this. does anyone have any ideas? thanks for the help,
dave

dvmorris
22nd April 2007, 23:43
I found a post here that had some example code similar to what is in qcumber.h, so i changed qcumber.h to read:



#ifdef _QCUMBER_BUILD_
#if (defined(QT_DLL) || defined(QT_SHARED)) && !defined(QT_PLUGIN)
#define QCUMBER_EXPORT Q_DECL_EXPORT
#else
#define QCUMBER_EXPORT Q_DECL_IMPORT
#endif
#else
#define QCUMBER_EXPORT
#endif


instead of



#ifdef _QCUMBER_BUILD_
#if (defined(QT_DLL) || defined(QT_SHARED)) && !defined(QT_PLUGIN)
#define QCUMBER_EXPORT Q_DECL_EXPORT
#else
#define QCUMBER_EXPORT
#endif
#else
#define QCUMBER_EXPORT Q_DECL_IMPORT
#endif


it works now, so i'll take it, but i'm really not sure if that's the proper fix.

fullmetalcoder
23rd April 2007, 20:16
it works now, so i'll take it, but i'm really not sure if that's the proper fix.
That's a proper fix. Apologies for it not working in the version you used but I also think it is important to mention that the SVN was alright :

$ svn co https://edyuk.svn.sourceforge.net/svnroot/edyuk/trunk/3rdparty/qcumber qcumber