Engine3d.so problem with compiled executables.

Linux specific forum
EdzUp[SD]
Enthusiast
Enthusiast
Posts: 104
Joined: Thu Jun 26, 2008 10:53 pm
Location: Banstead, UK

Engine3d.so problem with compiled executables.

Post by EdzUp[SD] »

I have created an executable of my Elite Multiplayer project this works 100% fine in the ide not a problem at all. When I create an executable for it in the same directory as the source files (complete with Engine3d.so) it cannot initialise the 3d engine.

Anyone have any idea why this is, my computer is:
AMD Athlon 64 3400
1.25Gb ram
Ubuntu Linux 8.10 (all updated)
ATI Radeon Sapphire HD2600 (512Mb)
PureBasic 4.3

It happens with all 3d executables.
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

How do you start the executable? Through terminal or through a filebrowser? Those filebrowsers often don't run the executables within their directory.

Try the following on a terminal:

Code: Select all

cd /path/to/your/exec/
./theexecutablefile
bye,
Daniel
EdzUp[SD]
Enthusiast
Enthusiast
Posts: 104
Joined: Thu Jun 26, 2008 10:53 pm
Location: Banstead, UK

Post by EdzUp[SD] »

apparently its missing the .so file, but the help documentation for PB tells you to copy the Engine3d file to the application directory
Anonymous

Post by Anonymous »

Put Engine3D.so in usr/lib ?
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

EdzUp[SD] wrote:apparently its missing the .so file, but the help documentation for PB tells you to copy the Engine3d file to the application directory
The documentation says many things if the day is long (And here its only the half truth, because the current directory often is the executable directory). Try it the way I told you.

Or try it with this at the first line of your code:

Code: Select all

SetCurrentDirectory(GetPathPart(ProgramFilename()))
bye,
Daniel
EdzUp[SD]
Enthusiast
Enthusiast
Posts: 104
Joined: Thu Jun 26, 2008 10:53 pm
Location: Banstead, UK

Post by EdzUp[SD] »

Cpl.Bator:trying to get it to work like the docs say to, I have a feeling your right tho that I will in the end have bite the bullet.

DarkDragon: Done the path command still nothing, even added the last minute adjustment to InitEngine3d( "./engine3d.so" )... still nothing.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

initEngine3D() accepts an argument... the path to the engine3d.so ..
i.E

Code: Select all

InitEngine3D("/home/username/yourapp/engine3.so")
this should do the trick :wink:

and AFAIK only an absolute path works atm ... so that's maybe the bug ...
Fred
Administrator
Administrator
Posts: 18248
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

linux uses LD_LIBRARY_PATH env var to search the shared libs. So you have to put your path in it (or '.').
EdzUp[SD]
Enthusiast
Enthusiast
Posts: 104
Joined: Thu Jun 26, 2008 10:53 pm
Location: Banstead, UK

Post by EdzUp[SD] »

I used

Code: Select all

InitEngine3d( "./engine3d.so" )
Also /home/edzup/Programming/purebasic/projects/Elite_Multiplayer/

Still causes an error that it cant find engine3d.so, yes ive even tried changing to the application directory, still nothing.
Fred
Administrator
Administrator
Posts: 18248
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

try to put "export LD_LIBRARY_PATH=." in your bash before launching your program.
EdzUp[SD]
Enthusiast
Enthusiast
Posts: 104
Joined: Thu Jun 26, 2008 10:53 pm
Location: Banstead, UK

Post by EdzUp[SD] »

will try it
Post Reply