1

In linux , the .a file is usually the static lib and the .so file is the dynamic file? I want to know is there any way to compile the .so file into the executable file as part of it? I googled it and did not find the method. who can help me ?

python
  • 1,870
  • 4
  • 24
  • 35

2 Answers2

2

Static linking is dead in Linux, I suggest you not to compile static library although you can in Linux. Such feature is fine under Windows, however it is not the case in the current development trend in Linux.

Linux static linking is dead?

Static link of shared library function in gcc

Community
  • 1
  • 1
tomriddle_1234
  • 3,145
  • 6
  • 41
  • 71
1

If the .so file is something you built yourself from source code, then you can change the build settings to make it a .a file, and link it statically.

If somebody else created the .so file, then no, there's no simple way to statically link it into the executable file.

Bob Murphy
  • 5,814
  • 2
  • 32
  • 35