开发者

difference between .so.0 and .so.0.0.0 files

开发者 https://www.devze.com 2022-12-15 06:04 出处:网络
Im using a market data source implementation that contains .so.0 files. However these are \'soft links\' to actual .so.0.0.0 files. Why is this done?

Im using a market data source implementation that contains .so.0 files. However these are 'soft links' to actual .so.0.0.0 files. Why is this done?

When I try to copy these .so.0 links, it ends up copying开发者_如何学编程 an exact replica of the .so.0.0.0 file but with a .so.0 prefix.

Added comment:

so I have a libfoo.so file, and it is being accessed by java through jni. This libfoo.so file is actually a soft link that points to libfoo.so.0.0.0 What happens if I don't have libfoo.so. How does java/or any other compiled code, figure out that libfoo.so.0.0.0 if the shared object to use?


This is so programs can bind to either any version of libfoo that has the same interface (I want the latest updates to libfoo), or bind to a specific version (I want stability and only the exact version I tested against).


The .0 and .0.0.0 files exist so that versioning can happen:

  • foo.0 represents the .0 version of a library. All .0 versions of the library will use the same interface, but there may be different implementations. (Hopefully, the later implementations will have fewer bugs than the earlier ones.)

  • foo.0.0.0 represents a specific implementation of the .0 version.

It's not useful, now, to have the soft-link. But here's what could happen:

The programmer of foo finds a bug in his library. He releases foo.0.0.1. And foo.0 now links to foo.0.0.1. Then two things happen:

  • All files that link to foo.0 will automatically update to foo.0.0.1.
  • All files that link to foo.0.0.0 will continue to use the old foo.0.0.0
0

精彩评论

暂无评论...
验证码 换一张
取 消