Skip to main content
rm greetings and apology
Source Link
tshepang
  • 67.7k
  • 94
  • 226
  • 297

This is one of those questions I'm not sure where it falls, so bear with me.

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:

  • example.so.1
  • example.so.2

I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that example.so is in fact a symbolic link to example.so.2 where .2 is the latest version. How then does an application depending on an older version of example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?

I suspect this is related to ldconfig but I'm not sure how. I also apologise as this is relatively open ended-I suspect however it can be answered.

This is one of those questions I'm not sure where it falls, so bear with me.

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:

  • example.so.1
  • example.so.2

I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that example.so is in fact a symbolic link to example.so.2 where .2 is the latest version. How then does an application depending on an older version of example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?

I suspect this is related to ldconfig but I'm not sure how. I also apologise as this is relatively open ended-I suspect however it can be answered.

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:

  • example.so.1
  • example.so.2

I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that example.so is in fact a symbolic link to example.so.2 where .2 is the latest version. How then does an application depending on an older version of example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?

I suspect this is related to ldconfig but I'm not sure how.

Source Link
user119
user119

How do SO (shared object) numbers work?

This is one of those questions I'm not sure where it falls, so bear with me.

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:

  • example.so.1
  • example.so.2

I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that example.so is in fact a symbolic link to example.so.2 where .2 is the latest version. How then does an application depending on an older version of example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?

I suspect this is related to ldconfig but I'm not sure how. I also apologise as this is relatively open ended-I suspect however it can be answered.