Results 1 to 3 of 3

Thread: How to use a shared library - beginner

  1. #1
    Join Date
    Mar 2011
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to use a shared library - beginner

    I downloaded QLed plugin from the follwing link:
    http://qt-apps.org/content/show.php/QLed+?content=72482
    Then I compiled it successfully. Then got the file libqledplugin.so (I'm using ubuntu 10.04) in the build directory.
    I just copied that file into my test project folder and compiled but getting the following error:
    libqledplugin: no such file or directory
    The test project was the same example downloaded along with the stuff in the above link. In .pro file the following code:
    LIBS += libqledplugin
    is already added in the example file. I don't know how to compile it successfully. Please help, I am a beginner.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use a shared library - beginner

    You just need to give the name of library

    LIBS += -lqledplugin

    also if you want to give path,
    LIBS += L<lib path> -l<libname>

  3. #3
    Join Date
    Mar 2011
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use a shared library - beginner

    I already added,
    LIBS += qledplugin
    I am getting another error when adding
    LIBS += -qledplugin

    I copied the .so file into the current project directory. Is there any need to give the path explicitly? If I add path as you said, I am getting the same error.


    Added after 1 16 minutes:


    Hi there,
    I got worked the program for the first time. But it works only when
    1)adds LIBS+= libqledplugin.so into the .pro file
    2)the same file is copied into qt/lib directory

    How to include the path in to the working directory? I used INCLUDEPATH but no use. I insist present directory because of the easiness while sharing the program to other computers.
    Last edited by tomkonikkara; 2nd March 2011 at 14:08.

Similar Threads

  1. how to use shared library
    By assismvla in forum Qt Programming
    Replies: 3
    Last Post: 25th September 2009, 22:29
  2. Shared Library Creation
    By tntcoda in forum Qt Programming
    Replies: 1
    Last Post: 1st February 2009, 00:48
  3. Qt/Mac Shared Library
    By nareshqt in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2008, 08:21
  4. so shared library problem
    By mtrpoland in forum Newbie
    Replies: 3
    Last Post: 13th August 2007, 22:51
  5. shared library problem
    By nhatkhang in forum KDE Forum
    Replies: 9
    Last Post: 28th November 2006, 05:07

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.