[Linux] FMOD libfmodex.so not found
BlitzMax Forums/Brucey's Modules/[Linux] FMOD libfmodex.so not found
| ||
I compiled fmodaudio.mod/examples/example_01.bmx and copied libfmodex.so from fmod.mod/lib/linux/libfmodex.so to the examples directory. Here's the output: /example_01: error while loading shared libraries: libfmodex.so: cannot open shared object file: No such file or directory If I put libfmodex.so in /usr/lib it will work fine. Copying the 'lib' folder from fmod.mod to the examples directory does not work either (fmod.mod examples have the same issue). |
| ||
Welcome to the wonderful world of Linux. You can get around this by : 1) adding the directory to LD_LIBRARY_PATH 2) adding the directory to a .conf file in /etc/ld.so.conf.d (or similar, depending on your Linux configuration). 3) running from a shell script which pre-configures the .so location before execution. 3. is a good option when "installing" the application, as you can have the menu entry kick off the script on user selection - rather than run the binary directly. The downside to /usr/lib installation is the requirement of root/sudo permissions, which you want to avoid if possible. Something like this should work : #!/bin/bash export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd` ./my.exe A proper installer is the best way to go, or course, rather than having the user run it from the command-line. Your mileage may vary :-) |
| ||
Hm. I assumed the current directory was always a search path. Thanks. |
| ||
You can always add "." to LD_LIBRARY_PATH ;-) |
| ||
I think I'll use the script approach with the proper paths (I'd like to stay out of /usr/lib). It's not too much to ask for Linux users to run a setup script or chmod a run script :p |