Results 1 to 3 of 3

Thread: how to link external library in qt linux?

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to link external library in qt linux?

    hi,

    i want to use a driver API in my app.
    so i linked the library in this manner in pro file:L/root/dscud-6.02/libdscud-6.02.a -lpthread -lm
    and included the .h file.

    i am getting the undefined reference when i call the driver functions:

    i want to know whether the error is due to the improper linking of the driver library or
    the driver library it self
    as i tried from the outside the qt(through a C program). It was sucessful.
    as i am knew to the Qt programming.i am placing this question.

    can any one clarify me .

    Thakz in advance..

    @qtlinuxnewbie.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to link external library in qt linux?

    you have to add the library and library path to the pro file.
    Read the qmake documentation on the specifics of how to do it.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to link external library in qt linux?

    The problem was solved:
    actually that was my mistake:
    i placed
    -L/root/dscud-6.02/libdscud-6.02.a -lpthread -lm
    instead of
    -L/root/dscud-6.02/ libdscud-6.02.a -lpthread -lm

    @qtlinuxnewbie

Similar Threads

  1. Replies: 0
    Last Post: 1st November 2009, 20:28
  2. How to link library?
    By Macok in forum Qt Tools
    Replies: 1
    Last Post: 31st March 2009, 16:47
  3. Adding an external Library
    By afflictedd2 in forum Qt Programming
    Replies: 1
    Last Post: 13th December 2008, 05:51
  4. Link *.so library
    By allstar in forum Qt Programming
    Replies: 1
    Last Post: 8th July 2007, 15:27
  5. How to open external page link using tabwidget
    By jyoti in forum Qt Programming
    Replies: 2
    Last Post: 13th November 2006, 10:43

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.