How to fix one of the shared libraries (.so) in a Linux project?

I want to quickly fix one of the .so project libraries. Is it safe to just recompile .so and replace the original? Or do I need to rebuild and reinstall the entire project? Or does it depend?

+5
source share
5 answers

It depends. The shared library must be binary compatible with your executable.

For instance,

  • If you changed the behavior of one of the internal functions of the library, you probably do not need to recompile.
  • (, ), , , , , , , , .
  • , , , , ( case C, ++ , , ).

( ) , , , , , .

+4

, , : - , , , , . , , , , .

, , , ; c'est la vie.

+1

ABI , .

+1

, .

:

+1

.

However, I assume that you have the same source and compiler that built the different material, and now, if you just change something in the file .cpp, that's fine.

Other things, for example. changing the interface (between the shared lib and the rest of the system) in the header file is not accurate.

+1
source

All Articles