No, it also happens in Debian directly installed on PC (a user who is using Debian drew my attention to this problem, that why I installed Debian in VirtualBox).
I tried all above suggestions, but none with success. I think the best solution is OpenLibrary(), but I tried that as well and it generates an memory error. I used this example https://www.un4seen.com/stuff/bass24-pb.zip as a test and replaced the .dll filenames with .so but maybe that's not the correct way for Linux.
Martin Verlaan wrote:I think the best solution is OpenLibrary(), but I tried that as well and it generates an memory error. I used this example https://www.un4seen.com/stuff/bass24-pb.zip as a test and replaced the .dll filenames with .so but maybe that's not the correct way for Linux.
It's an old include file for 32 bit.
You will need to replace quite a bit of .l (Long) types into .i (Integer) to make it work on 64 bit.
Edit:
I might have been to fast with my conclusion.
Most things seem to work fine without converting .l to .i
Last edited by wilbert on Fri Aug 10, 2018 4:08 pm, edited 1 time in total.
Maybe some distros search for shared libraries in the current directory per default, but usually they don't.
You can add '.' to LD_LIBRARY_PATH before running the binary. Or you properly install the library in your system including running ldconfig so its being found in the default locations.
For a test you may just open a terminal in the binary directory and try
Still there is one thing I don't understand. I am using an relative path with Import, so why does Import refers to my source folder and not to the folder in which it was compiled and saved. To me, this looks like a bug.
You are right. If you move the binary and the *.so around then the binary will still use the lib from the original source folder. If you rename the original lib file then the copied binary won't run. I don't know if this is right or wrong though. 'Create executable in the source directory' doesn't change anything about that and is only for running from IDE.
Linux Debian is configured by default as a normal Unix (i.e. secured against misuse)
So there is no path on the current directory. (verify: echo $PATH does not end with :.)
Add an . in the PATH variable and try again
Okay, learned a lot today. I will use import "\usr\lib\smartmix\file.so" and I will include a folder "smartmix" with the executable. I will tell the users of my program that they must copy this folder to \usr\lib\ and then everything will be fine Thanks everybody for your replies.
Oh and the reason it works here in Linux Mint, is because the source code folder exist there! In a clean installed Mint it will not work (just like Debian), so I have to follow above method for that distro as well. I am happy that I understand it now.