Results 1 to 2 of 2

Thread: qmake LIBS

  1. #1

    Default qmake LIBS

    Anyone help w/ the following errors. I'm not sure I've got the correct stuff in my makefile's *.pro because of these errors.

    $ ./myapp --help
    ./myapp: error while loading shared libraries: libtinyxml.so.1: cannot open shared object file: No such file or directory

    Qt Code:
    1. INCLUDEPATH += ../includes ./includes ../libs/tinyxml
    2. LIBS += -L/usr/lib64/boost-1_41 -lboost_program_options -L../libs/tinyxml -ltinyxml
    3.  
    4. CONFIG +=
    5. HEADERS +=
    6. SOURCES += main.cpp xmldoc.cpp
    7. TARGET = myapp
    To copy to clipboard, switch view to plain text mode 

    And if I do "cd ../libs/tinyxml", I have this built.
    Qt Code:
    1. $ ls
    2. total 468
    3. -rw-r--r-- 1 7680 Jul 14 17:51 Makefile
    4. lrwxrwxrwx 1 19 Jul 14 17:51 libtinyxml.so -> libtinyxml.so.1.0.0
    5. lrwxrwxrwx 1 19 Jul 14 17:51 libtinyxml.so.1 -> libtinyxml.so.1.0.0
    6. lrwxrwxrwx 1 19 Jul 14 17:51 libtinyxml.so.1.0 -> libtinyxml.so.1.0.0
    7. -rwxr-xr-x 1 99729 Jul 14 17:51 libtinyxml.so.1.0.0
    8. -rw-r--r-- 1 2602 Jul 14 17:45 tinystr.cpp
    9. -rw-r--r-- 1 8783 Jul 14 17:45 tinystr.h
    10. -rw-r--r-- 1 5184 Jul 14 17:51 tinystr.o
    11. -rw-r--r-- 1 36435 Jul 14 17:45 tinyxml.cpp
    12. -rw-r--r-- 1 64316 Jul 14 17:45 tinyxml.h
    13. -rw-r--r-- 1 85256 Jul 14 17:51 tinyxml.o
    14. -rw-r--r-- 1 167 Jul 14 17:50 tinyxml.pro
    15. -rw-r--r-- 1 1780 Jul 14 17:45 tinyxmlerror.cpp
    16. -rw-r--r-- 1 2368 Jul 14 17:51 tinyxmlerror.o
    17. -rw-r--r-- 1 37193 Jul 14 17:45 tinyxmlparser.cpp
    18. -rw-r--r-- 1 41576 Jul 14 17:51 tinyxmlparser.o
    19. -rw-r--r-- 1 41492 Jul 14 17:45 xmltest.cpp
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qmake LIBS

    You shouldn't use relative paths when specifying dynamic library locations. Try substituting absolute paths and see if that helps.

    More importantly, your app needs to be able to find the dynamic libraries at runtime. Either set your LD_LIBRARY_PATH environment variable with the absolute path to your libraries, or (as a temporary measure) put your app in the same directory as your libraries and run it from there; you'll need to do something more robust eventually, but at least you'll get past this particular problem.

    Finally, read up on rpath and other topics concerning runtime linking.

Similar Threads

  1. qmake LIBS missing quotes
    By redoctober0 in forum General Programming
    Replies: 1
    Last Post: 12th January 2011, 16:05
  2. qmake absolute vs relative LIBS path
    By TheShow in forum Newbie
    Replies: 7
    Last Post: 12th October 2010, 14:40
  3. qmake multiple shared libs
    By rrlangly in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2010, 23:32
  4. Installing libs/headers with qmake
    By ghorwin in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2007, 20:01
  5. qmake, conditioning & bundled libs
    By sebr in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2006, 09: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.