Results 1 to 2 of 2

Thread: Library export macros on windows

  1. #1
    Join Date
    May 2009
    Posts
    63
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Library export macros on windows

    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:

    Qt Code:
    1. #include <QtCore/qglobal.h> // note: this was added by QTCreator
    2.  
    3. #ifdef Q_WS_WIN
    4. // This section is grayed out ????!
    5. #define EXPORT __declspec(dllexport)
    6. #else
    7. #define EXPORT
    8. #endif
    To copy to clipboard, switch view to plain text mode 

    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 please help!

  2. #2
    Join Date
    May 2009
    Posts
    63
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Talking Re: Library export macros on windows

    OK just realized that WIN32 is only defined during compilation.

Similar Threads

  1. Replies: 5
    Last Post: 15th January 2009, 09:03
  2. How to use a library (LAPACK) with Qt? (Windows)
    By Skywalker in forum Qt Programming
    Replies: 7
    Last Post: 5th January 2009, 20:31
  3. Link errors when linking chained libraries on windows
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 14:52
  4. Please Help-->have few doubts with Static build in Windows !
    By Krish in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2008, 14:37
  5. MinGW Windows Library Search Path
    By zztop in forum Qt Programming
    Replies: 4
    Last Post: 26th March 2006, 15:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.