Results 1 to 7 of 7

Thread: How to add external Header files and libraries?

  1. #1
    Join Date
    Mar 2010
    Location
    Alipurduar, India
    Posts
    8
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to add external Header files and libraries?

    Hi,

    I m using QT Creator (QT 4) for learning QT.

    I need to include some external header files and libraries to my project. How can i do that?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to add external Header files and libraries?

    simply include the header files of the library via
    Qt Code:
    1. #include "/path/to/library/header.h"
    To copy to clipboard, switch view to plain text mode 
    and then use LIBS in your *.pro file. See the documentation for more info.

  3. The following user says thank you to Lykurg for this useful post:

    Zlatomir (30th September 2010)

  4. #3
    Join Date
    Jan 2010
    Posts
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4

    Default Re: How to add external Header files and libraries?


  5. The following user says thank you to gurmukh for this useful post:

    Zlatomir (30th September 2010)

  6. #4
    Join Date
    Sep 2010
    Location
    Israel
    Posts
    24
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add external Header files and libraries?

    I've read about this on line and I can't seem to get the hang of it. I have directory full of h, lib and dll files that I need linked with my code. How do I get Qt to use all of them?

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

    Default Re: How to add external Header files and libraries?

    header files: include them in your code
    lib files: add LIBS += -l<libname> to .pro file of your project
    dll files: these are not required for compilation.
    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.


  8. The following user says thank you to wysota for this useful post:

    Zlatomir (30th September 2010)

  9. #6
    Join Date
    Sep 2010
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to add external Header files and libraries?

    What if I wish to add a .dll file to my project rather than a .lib? It doesn't seem to recognize that format.

  10. #7
    Join Date
    Sep 2010
    Posts
    145
    Thanks
    1
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to add external Header files and libraries?

    You don't. Your project relies on X.lib which in turns relies on X.dll. Your project does not need X.dll to compile, only for execution.

Similar Threads

  1. QtCreator and external libraries
    By GiuseppeBonfa in forum Qt Tools
    Replies: 6
    Last Post: 22nd May 2012, 00:26
  2. Replies: 4
    Last Post: 22nd May 2011, 14:36
  3. Replies: 6
    Last Post: 10th November 2009, 16:18
  4. Replies: 4
    Last Post: 7th May 2009, 08:19
  5. Does Qt have his proper libraries to handle files?
    By Colx007 in forum Qt Programming
    Replies: 2
    Last Post: 9th October 2007, 16:52

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.