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 ?
Asked
Active
Viewed 294 times
1
-
possible duplicate of [Static link of shared library function in gcc](http://stackoverflow.com/questions/725472/static-link-of-shared-library-function-in-gcc) – Brian Campbell Dec 05 '12 at 05:37
-
There are already several good answers at the link listed above. – Brian Campbell Dec 05 '12 at 05:38
2 Answers
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.

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