Results 1 to 3 of 3

Thread: Link shared library .so files

  1. #1
    Join Date
    Jul 2016
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Link shared library .so files

    Hi,
    I want to link my .so file to the cpp.
    I also have a .h file that is used in the cpp.

    What can I do?

    I don't want to modify the pro file because I musn't use it

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

    Default Re: Link shared library .so files

    Well, you need to modify the .pro file because you need to tell the linker about the library and that is done with the LIBS variable in the .pro file.

    Cheers,
    _

  3. #3
    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: Link shared library .so files

    Assuming:
    • you are on a Linux box or the like
    • you are not using Qt because you must not use a PRO file
    • you are using GCC and associated tools

    then you want the -L and -l options to your linker (ld)

Similar Threads

  1. Link to a specific version of shared library
    By P51D in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2016, 08:02
  2. How to link a shared library to app
    By kamlmish in forum Newbie
    Replies: 1
    Last Post: 25th December 2010, 21:57
  3. Can I link shared library in static build program?
    By berlinud in forum Installation and Deployment
    Replies: 1
    Last Post: 27th August 2010, 17:36
  4. Is it possible to link the qt library files into exe?
    By hashb in forum Installation and Deployment
    Replies: 2
    Last Post: 7th January 2010, 15:41
  5. Problem with NCReport : can't link shared library !
    By QAmazigh in forum Qt Programming
    Replies: 4
    Last Post: 6th June 2009, 00:38

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.