PDA

View Full Version : qmake LIBS



rrlangly
15th July 2010, 01:19
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



INCLUDEPATH += ../includes ./includes ../libs/tinyxml
LIBS += -L/usr/lib64/boost-1_41 -lboost_program_options -L../libs/tinyxml -ltinyxml

CONFIG +=
HEADERS +=
SOURCES += main.cpp xmldoc.cpp
TARGET = myapp


And if I do "cd ../libs/tinyxml", I have this built.


$ ls
total 468
-rw-r--r-- 1 7680 Jul 14 17:51 Makefile
lrwxrwxrwx 1 19 Jul 14 17:51 libtinyxml.so -> libtinyxml.so.1.0.0
lrwxrwxrwx 1 19 Jul 14 17:51 libtinyxml.so.1 -> libtinyxml.so.1.0.0
lrwxrwxrwx 1 19 Jul 14 17:51 libtinyxml.so.1.0 -> libtinyxml.so.1.0.0
-rwxr-xr-x 1 99729 Jul 14 17:51 libtinyxml.so.1.0.0
-rw-r--r-- 1 2602 Jul 14 17:45 tinystr.cpp
-rw-r--r-- 1 8783 Jul 14 17:45 tinystr.h
-rw-r--r-- 1 5184 Jul 14 17:51 tinystr.o
-rw-r--r-- 1 36435 Jul 14 17:45 tinyxml.cpp
-rw-r--r-- 1 64316 Jul 14 17:45 tinyxml.h
-rw-r--r-- 1 85256 Jul 14 17:51 tinyxml.o
-rw-r--r-- 1 167 Jul 14 17:50 tinyxml.pro
-rw-r--r-- 1 1780 Jul 14 17:45 tinyxmlerror.cpp
-rw-r--r-- 1 2368 Jul 14 17:51 tinyxmlerror.o
-rw-r--r-- 1 37193 Jul 14 17:45 tinyxmlparser.cpp
-rw-r--r-- 1 41576 Jul 14 17:51 tinyxmlparser.o
-rw-r--r-- 1 41492 Jul 14 17:45 xmltest.cpp

SixDegrees
15th July 2010, 01:29
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.