Results 1 to 6 of 6

Thread: Adding Dll

  1. #1
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Adding Dll

    how can i add Dll File and use it in Qt Creator ??

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Adding Dll

    You don't. You add the lib file to your .pro and it references the dll file for you.

  3. #3
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding Dll

    what if there is no lib file just dll and header file

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Adding Dll

    If you are using MingW in the Qt SDK then you can probably reference the DLL directly with:
    Qt Code:
    1. LIBS += something.dll
    To copy to clipboard, switch view to plain text mode 
    but I haven't tried that (based on the info here http://www.mingw.org/wiki/sampleDLL). Typically you would have the import library (something.lib for MSVC or libsomething.a for MingW) and use it like fatjiucymole posted. MingW can create an import library from a DLL too: http://www.mingw.org/wiki/CreateImportLibraries

  5. #5
    Join Date
    Jun 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding Dll

    in MSVC it creates type library (tbl file) when i add dll file
    and as i know lib file is static library why i can't deal with dll directly

    i w'll try what ChrisW67 said
    thank you

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Adding Dll

    The suggestions I made are for MingW not MSVC.

    The LIB file defines the entry points for the DLL so the linker knows they exist and can set up dynamic loading/linking of the DLL. The LIB file is not a static library of routines in its own right. If there's a type library (TLB) file then the DLL is probably a COM object that could be dynamically accessed using ActiveQt.

Similar Threads

  1. Adding Icons
    By bijan311 in forum Newbie
    Replies: 2
    Last Post: 27th March 2010, 22:43
  2. Adding more tab widgets
    By rakkar in forum Newbie
    Replies: 2
    Last Post: 10th September 2009, 21:22
  3. Adding a Progress bar
    By srohit24 in forum Qt Programming
    Replies: 15
    Last Post: 1st June 2009, 09:52
  4. adding a qt-ui to a non-qt project, dll
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 28th February 2007, 17:08
  5. adding my wdget to Tab
    By therealjag in forum Qt Programming
    Replies: 2
    Last Post: 18th February 2006, 19:28

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.