Results 1 to 4 of 4

Thread: Q_DECL_EXPORT and Q_DECL_IMPORT

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_DECL_EXPORT and Q_DECL_IMPORT

    Quote Originally Posted by Gopala Krishna View Post
    Can someone help me understand this clearly ?
    It's M$ idea. When you write DLLs, you have to explicitly mark objects (functions, classes or variables) that should be visible from the outside and you do this with __declspec(dllexport) tag. All other objects won't be accessible from the outside and only DLL code will be able to use them.

    Using GCC and other Unix compilers you can do the same with linker scripts (or __attribute__ tag), so you don't need funny macros.

    Quote Originally Posted by Gopala Krishna View Post
    Why is the QCUMBER_EXPORT defined to be Q_DECL_IMPORT ? (export - import )
    Because an object has to be exported when you compile the library and imported when you use the library. That's why you need a macro that is once Q_DECL_EXPORT and once Q_DECL_IMPORT.

  2. The following user says thank you to jacek for this useful post:

    Gopala Krishna (7th July 2007)

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.