PDA

View Full Version : Library export macros on windows



jonks
10th May 2009, 01:53
I'm using QT Creator on Windows.

I've created a library project (called "test"), and am trying to export some functions.
Inside my "test_global.h" that QT Creator creates for me, I've added the following:



#include <QtCore/qglobal.h> // note: this was added by QTCreator

#ifdef Q_WS_WIN
// This section is grayed out ????!
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif


Now, even though I'm developing on Windows, Q_WS_WIN is not defined.
I've dug into the qglobal.h file, and noticed that WIN32 is not defined, which is why Q_WS_WIN is not defined. ...So, please...where should I define WIN32?

Confused :confused: please help!

jonks
10th May 2009, 04:07
OK just realized that WIN32 is only defined during compilation.