From: Orin E. <ori...@gm...> - 2010-03-29 21:03:22
|
On Mon, Mar 29, 2010 at 1:16 PM, Peter Stuge <pe...@st...> wrote: > Hi Philip, > > Phi...@mi... wrote: > > We have developed an application using a specific version of libusb > > (say, 1.0.3). > > Okey. > > > > We are linked into that version's library. > > Hm. This confuses me, also considering the subject of your message, > which suggests that your application uses dlopen() to load libusb. > Could you please clarify a little? > > > > My question is: When we have two versions of libusb on a system (say > > 1.0.0 and 1.0.3) and we call libusb_init( ), how do we specify one > > over the other? > > In *ix systems this is not specified explicitly. > > That said, libraries can of course implement their own version check > or version requirements, but in that case the init function would > require a version to be specified. (Similar to WSAStartup() in > winsock.) libusb has no such support though. > > > > Or is that taken care of because we linked to one specific version? > > Sort-of. When you link, the linker records the so-called soname > (ABI version) of the library that you're linking with. Later when > the program is executed, the loader will look for a libusb-1.0, any > libusb-1.0, with the same soname. > > > > The bigger problem appears to be that the build of 1.0.3 > > (configure, make, make install) produces the same-named .so and > > link files as 1.0.0. > > Note that ABI version/soname is different from release version. So > far, all the 1.0.* releases have the same soname, and are thus > upwards binary compatible. This is the reason that they have the > same .so and .a filenames. > > > > Do I need to modify the make or make install to give a specific > > name to the so and link results? > > That should never be neccessary. > I disagree. The current scheme does not allow an application to specify the release should it require a certain bug fix. The same problem exists with the Darwin builds. I simply couldn't specify libusb-1.0.<minimum release> or better. For that reason, I had to do my own build, targeted at a different install directory and provide instructions for a user to build and install their own later version. Orin. |