maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   set LD_LIBRARY_PATH esbox (https://talk.maemo.org/showthread.php?t=67523)

waelfarouk0 2010-12-27 18:49

set LD_LIBRARY_PATH esbox
 
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

Joorin 2010-12-28 01:07

Re: set LD_LIBRARY_PATH esbox
 
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.

dannym 2011-01-03 10:54

Re: set LD_LIBRARY_PATH esbox
 
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?

waelfarouk0 2011-01-03 12:05

Re: set LD_LIBRARY_PATH esbox
 
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

Quote:

Originally Posted by dannym (Post 910412)
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?


dannym 2011-01-03 14:42

Re: set LD_LIBRARY_PATH esbox
 
Yes, or append the path to /etc/ld.so.conf

waelfarouk0 2011-01-03 15:12

Re: set LD_LIBRARY_PATH esbox
 
Quote:

Originally Posted by dannym (Post 910567)
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

jstokes 2011-01-03 15:14

Re: set LD_LIBRARY_PATH esbox
 
Quote:

Originally Posted by waelfarouk0 (Post 910595)
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)

Joorin 2011-01-03 18:40

Re: set LD_LIBRARY_PATH esbox
 
Quote:

Originally Posted by waelfarouk0 (Post 910454)
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.


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

vBulletin® Version 3.8.8