PDA

View Full Version : Getting qextserial to work



eva2002
15th January 2010, 06:02
Hi all,

I am trying to get qextserial to work in qt creator.

I dl the qextserial 1.1 -> extract -> qmake -> make it.

in my project, under project.pro I added

INCLUDEPATH += /home/......../qextserialport
QMAKE_LIBDIR += /home/......./qextserialport/build
LIBS += -lqextserialport
unix:DEFINES = _TTY_POSIX_
win32:DEFINES = _TTY_WIN_ \
QWT_DLL \
QT_DLL

all paths are right. Compilation works but whent I tried to run it, I got

"error while loading shared libraries: libqextserialport.so.1: cannot open shared object file: No such file or directory"

where should I place the lib files?

high_flyer
15th January 2010, 10:27
where should I place the lib files?
either in a path known to LD_LIBRARY_PATH, or in the same folder as your executable.

eva2002
16th January 2010, 02:01
I tried by coping over the lib files to the executable folder and also /usr/lib. however when I run the executables, the program crashes. Under Debug screen I got tons of warnings.

Starting /home/EVA/Desktop/Project/c-examples/mul_form/mul_form...

warning: .dynamic section for "/lib/libpthread.so.0" is not at the expected address
.dynamic section for "/lib/libpthread.so.0" is not at the expected address

warning: difference appears to be caused by prelink, adjusting expectations
difference appears to be caused by prelink, adjusting expectations

warning: .dynamic section for "/lib/libm.so.6" is not at the expected address

warning: difference appears to be caused by prelink, adjusting expectations

warning: .dynamic section for "/lib/librt.so.1" is not at the expected address

warning: difference appears to be caused by prelink, adjusting expectations

warning: .dynamic section for "/lib/libglib-2.0.so.0" is not at the expected address

warning: difference appears to be caused by prelink, adjusting expectations

...

Try: yum --enablerepo='*-debuginfo' install /usr/lib/debug/.build-id/85/b6149a8377a357541e89471eb7ee92474cc8de.debug
/home/EVA/Desktop/Project/c-examples/mul_form/mul_form exited with code 0

there are tons of it. Any idea how to resolve this. thanks.

norobro
16th January 2010, 21:04
Once upon a time I had this problem. I know of three ways to fix it, two of which high_flyer mentioned above. They are:


LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/qextserialport.so.1/ (somewhat frowned upon - see how-to referenced below)
cp qextserialpport.so.1 /executable/directory/
as root - add "/path/to/qextserialport.so.1/" to ld.so.conf and run ldconfig (man ldconfig & man ld.so)


Here (http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html) is a good read on shared libraries FYI.

eva2002
18th January 2010, 04:41
yup I manage to get it to work. its actually my mistake. I forgot to alloc memory to the variable. thanks