Reply
Thread Tools
Posts: 64 | Thanked: 13 times | Joined on Apr 2010
#1
Dear All,
Kindly we need how to set our project
LD_LIBRARY_PATH
Our project is C++ application (Not QT)
We tried right click >>properties>>c/c++ path and building >> symbols tab>> then we added LD_LIBRARY_PATH =/opt/appname/bin/


but it seems it has no effect


Can you help please
\

Regards
Wael
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#2
As far as I know, LD_LIBRARY_PATH only affects the loader. That is, it is only interesting to set when you're running your application.

So:
Code:
$ LD_LIBRARY_PATH=/opt/appname/bin app
Depending on which shell you're using, you might to tweak the placing of "=" and spacing.
 
Posts: 56 | Thanked: 31 times | Joined on Jul 2008 @ Austria
#3
I think waelfarouk0 means some IDE.
Which operating system?
As Joorin said, try to start your IDE using
$ LD_LIBRARY_PATH=/opt/appname/lib qtcreator

If you want it to always do it, put
export LD_LIBRARY_PATH=/opt/appname/lib
into file .bashrc or .bash_profile (including the dot) in your home directory and relogin.

But you said "not Qt", so which IDE?
 
Posts: 64 | Thanked: 13 times | Joined on Apr 2010
#4
right,

But also we needed to run application on device to run application from /opt/appname/
we found alternative solution is to compile the application with rpath option
we do like this in ac configure file

LDFLAGS='-Wl,-rpath,/opt/appname/lib:/usr/lib'

hope it is useful to everyone


Regards
Wael

Originally Posted by dannym View Post
I think waelfarouk0 means some IDE.
Which operating system?
As Joorin said, try to start your IDE using
$ LD_LIBRARY_PATH=/opt/appname/lib qtcreator

If you want it to always do it, put
export LD_LIBRARY_PATH=/opt/appname/lib
into file .bashrc or .bash_profile (including the dot) in your home directory and relogin.

But you said "not Qt", so which IDE?
 
Posts: 56 | Thanked: 31 times | Joined on Jul 2008 @ Austria
#5
Yes, or append the path to /etc/ld.so.conf
 
Posts: 64 | Thanked: 13 times | Joined on Apr 2010
#6
Originally Posted by dannym View Post
Yes, or append the path to /etc/ld.so.conf
Yes but for end user it is not accepted that direct the user to modify ld.so.conf


and rmember maemo is busybox may functions is disabled if you try access system
 
Posts: 235 | Thanked: 339 times | Joined on Nov 2010
#7
Originally Posted by waelfarouk0 View Post
Yes but for end user it is not accepted that direct the user to modify ld.so.conf
http://en.wikipedia.org/wiki/Rpath_(linking)
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#8
Originally Posted by waelfarouk0 View Post
right,

But also we needed to run application on device to run application from /opt/appname/
we found alternative solution is to compile the application with rpath option
we do like this in ac configure file

LDFLAGS='-Wl,-rpath,/opt/appname/lib:/usr/lib'

hope it is useful to everyone


Regards
Wael
The benefit of compiling the path into the binary is that it only affects that binary. The problem is that it locks the position of the .so file to one place only in the target environment.

To solve a similar problem with footify, I decided to use a wrapper script that sets LD_LIBRARY_PATH before starting the main application. That way it's at least possible to tinker with the wrapper script if the end user wants to move the .so file.

Both solutions have their strengths and weaknesses.
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:16.