Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static/dynamic libraries vs .so libaries?

I come from a windows w/ visual-studio background for native development and I am now going to compile native code for use on android.

I am not sure how the unix-like libraries (.so?) work. Are they static (like a .lib on windows) or dynamically loaded like a DLL? For example, in visual studio, I add the .lib file to my project for compiling, and then load the .dll during runtime. What is the equivalent in unix-stuff, say by using GCC?

Thanks!

like image 527
KaiserJohaan Avatar asked Jan 28 '26 12:01

KaiserJohaan


1 Answers

On Linux, the .so files are the equivalent(*) of the .dll files on Windows, in the sense that they are loaded dynamically to the executable when it is executed. Note however that you don't need a .lib file when linking your application. The linker will find the information directly in the .so file.

*: There are differences.

like image 134
Didier Trosset Avatar answered Jan 30 '26 04:01

Didier Trosset



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!