Results 1 to 4 of 4

Thread: Issues with development of DLL library using Qt/Qt Creator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Issues with development of DLL library using Qt/Qt Creator

    You don't need two headers. If you have only one public header you can also add the export/import macros to that header.
    It is just customary to split the macro definition into a separate header, because a library often has more than one public header and then you can just include the macro definition one in each of them.

    The import/export macro definition is required to get symbol visibility right. Depending on platform and compiler settings, symbols such as classes or functions can be "hidden" by the compiler, i.e. only visible within the library itself but not to the program linking the library.
    Naturally you want the symbols of your public API to be visible, hence the need to mark them for export.

    Since you mentioned static linking a couple of times: this has nothing to do with DLLs, a concept which has "Dynamic Linking" even as part of its name!

    Cheers,
    _

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

    Momergil (13th March 2014)

Similar Threads

  1. QT creator with Maemo issues in building
    By rg4gp in forum Newbie
    Replies: 0
    Last Post: 11th September 2012, 20:19
  2. Replies: 2
    Last Post: 19th February 2011, 11:26
  3. Replies: 0
    Last Post: 17th March 2010, 22:52
  4. QT Creator Linking issues
    By sgrant327 in forum Qt Programming
    Replies: 14
    Last Post: 16th December 2009, 15:42
  5. Replies: 1
    Last Post: 13th August 2009, 16:32

Tags for this Thread

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.