Create *.SO library

Linux specific forum
User_Russian
Addict
Addict
Posts: 1588
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Create *.SO library

Post by User_Russian »

In Windows, when you create a DLL, created also LIB-file.
In Linux, when creating SO library does not create *.a file! How to create it? Need for import functions from SO libraries.
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Create *.SO library

Post by idle »

You don't need a lib file equivalent on linux, Import works with shared objects as they are
Windows 11, Manjaro, Raspberry Pi OS
Image
User_Russian
Addict
Addict
Posts: 1588
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Create *.SO library

Post by User_Russian »

You mean:

Code: Select all

Import "MyLib.so"
  Funct(Param)
EndImport
But then it in the executable file be an absolute path to the so-file!
That is:
/home/UserName/PureBasic/Files/TestProject/MyLib.so
On another computer, the program will not work because there is no such file path!
User_Russian
Addict
Addict
Posts: 1588
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Create *.SO library

Post by User_Russian »

Prompt how to solve this problem?
Import is not meaningful because the absolute path!
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Create *.SO library

Post by idle »

Try adding the program path to the enviroment path on start up
or install the .SO under usr/lib

Importing an .SO still uses dlopen under the hood as far as I know
Windows 11, Manjaro, Raspberry Pi OS
Image
User_Russian
Addict
Addict
Posts: 1588
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Create *.SO library

Post by User_Russian »

In such case, better OpenLibrary() and prototypes.
Import in Linux, bad implemented. :( :!:
Post Reply