Results 1 to 10 of 10

Thread: How to use a class who has SHAREDEXPORT in 'direct' mode?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use a class who has SHAREDEXPORT in 'direct' mode?

    Thanks
    I'm going to re-read the Qt help regarding this.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to use a class who has SHAREDEXPORT in 'direct' mode?

    Qt help has nothing to do with this. This is strictly a C++ (or even cpp) issue. You know how #ifdef and #define work, right?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use a class who has SHAREDEXPORT in 'direct' mode?

    Thanks Wy.
    Ok, it works with :
    Qt Code:
    1. #ifndef ACORE_GLOBAL_H
    2. #define ACORE_GLOBAL_H
    3.  
    4. #include <QtCore/qglobal.h>
    5.  
    6. #if defined(ACORE_LIBRARY)
    7. # define W_FILESSSHARED_EXPORT Q_DECL_EXPORT
    8. # define W_UTILESSHARED_EXPORT Q_DECL_EXPORT
    9. # define W_QTUTILSHARED_EXPORT Q_DECL_EXPORT
    10. # define W_ASCIISHARED_EXPORT Q_DECL_EXPORT
    11. # define W_XMLSHARED_EXPORT Q_DECL_EXPORT
    12. # define W_CONFIGSHARED_EXPORT Q_DECL_EXPORT
    13. #else
    14. #if defined(ACORE_DIRECT)
    15. # define W_FILESSSHARED_EXPORT
    16. # define W_UTILESSHARED_EXPORT
    17. # define W_QTUTILSHARED_EXPORT
    18. # define W_ASCIISHARED_EXPORT
    19. # define W_XMLSHARED_EXPORT
    20. # define W_CONFIGSHARED_EXPORT
    21. #else
    22. # define W_FILESSSHARED_EXPORT Q_DECL_IMPORT
    23. # define W_UTILESSHARED_EXPORT Q_DECL_IMPORT
    24. # define W_QTUTILSHARED_EXPORT Q_DECL_IMPORT
    25. # define W_ASCIISHARED_EXPORT Q_DECL_IMPORT
    26. # define W_XMLSHARED_EXPORT Q_DECL_IMPORT
    27. # define W_CONFIGSHARED_EXPORT Q_DECL_IMPORT
    28. #endif
    29. #endif
    30. #endif // ACORE_GLOBAL_H
    To copy to clipboard, switch view to plain text mode 

    And DEFINES +=ACORE_DIRECT in the .pro file.
    Thanks.
    A last question :
    I use in my .pro:
    INCLUDEPATH += mypath
    DEPENDPATH += mypath
    So, I can write code and QTknows where the class I'm using are, but it does not compile.
    (Only compile if I add the files for the class to my project)
    What more I need?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to use a class who has SHAREDEXPORT in 'direct' mode?

    You need to tell your compiler you wish to have those classes compiled or linked into you project.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 4
    Last Post: 27th May 2010, 15:18
  2. Signal/slot or direct method call within a class
    By mike_the_tv in forum Newbie
    Replies: 6
    Last Post: 11th March 2010, 18:49
  3. Replies: 1
    Last Post: 2nd November 2009, 12:02
  4. Replies: 9
    Last Post: 15th April 2009, 06:23
  5. Replies: 8
    Last Post: 10th October 2007, 18:20

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
  •  
Qt is a trademark of The Qt Company.