Confusion about PATH


Trist06

Still Fresh
Joined
May 3, 2011
Messages
29
Hi guys,

Ive been porting a simple command line game first from java to c++ now to the pandora.

Ive gotten it to work perfectly in code::blocks but now im wanting to move it to a pnd.

When i go to run the executable from the regular terminal with ./a.out it tells me that it cant find /usr/lib/libstdc++.so.6 so i went and found that lib from the c::b pnd and put it in my working directory and even added it to my PATH.

The thing is that none of this helps and it seems that the binary is hard wired to look in /usr/lib which im guessing c::b is doing this at compile.

soooo, what would be my best bet arround this?

any help is greatly appreciated.

Edit: it looks like I can run it from the regular terminal when c::b is running, but when i close c::b the above error occurs
 
Last edited by a moderator:
Hi,

The library are not loaded from PATH, but from LD_LIBRARY_PATH.

You can find an (old) tutorial here: http://pandoralive.info/?p=700 on how to package.

For your software, I recommand doing the following:

1. Create a "lib" folder in your PND structure

2. Go inside that lib folder

3. type "copy_libs.sh path/to/your/binary" : that script will analyse the dependencies of your binarie and copy all library that are not in the firmware to the current lib. Plus, it strip everything after that. Ready to PNDize...

4. In your start script, you can add an export LD_LIBRARY_PATH to the lib folder you have created, but the PND system will also do it automaticaly (if you put your libs elsewhere, then you have to do it yourself).

I hope it was helpfull.
 
Last edited by a moderator:
Plus, it strip everything after that.
I would highly recommend not to strip things unless it's really necessary (like on huge projects like firefox where debug symbols may take 100+ MB). Having debug symbols is helpful for example when updating libs in firmware and some PND starts to crash. It's also very convenient when you can run perf anytime and see what's going on.
 
Plus, it strip everything after that.
I would highly recommend not to strip things unless it's really necessary (like on huge projects like firefox where debug symbols may take 100+ MB). Having debug symbols is helpful for example when updating libs in firmware and some PND starts to crash. It's also very convenient when you can run perf anytime and see what's going on.
Ah ok, I'll remove the stripping command from copy_libs.sh.
 
hello again,

im stuck on something else now, my program is command line driven. Now im wondering what the best way of keeping the terminal window open whilst the program is running, should I run it via /bin/sh in the start script in the pnd.

again any help is appreciated.
 
The Pandora OS comes with a terminal emulator called "Terminal" (from XFCE). You can use


/usr/bin/Terminal -e "$cmd"
to start it and have it exit with $cmd .
 
Back
Top