Linking in an .so on linux with rebuild?

"Jérôme M. Berger" jeberger at free.fr
Wed Sep 23 12:29:30 PDT 2009


grauzone wrote:
> Daniel Keep wrote:
>> I found a solution.
>>
>> See
>> http://stackoverflow.com/questions/335928/linux-gcc-linking-ld-cannot-find-a-library-that-exists 
>>
>>
>> For me, I needed readline and history, so I did this:
>>
>> $ cd /lib
>> $ sudo ln -s libreadline.so.5 libreadline.so
>> $ sudo ln -s libhistory.so.5 libhistory.so
>>
>> After that, ld didn't complain.
> 
> Interesting. On my system (Debian), the libreadline.so symlink is in a 
> separate -dev package. Who knows why.

	That's because those symlinks are only necessary when compiling. On 
linux, DLLs have actually three names:

  - libfoo.so.x.y.z or libfoo-x.y.z.so where x.y.z is the full 
version number. This one is a real file;
  - libfoo.so.x or libfoo-x.so where x is the ABI version number. 
This is the name that will actually be stored into executables and 
therefore the name that is necessary to run the program. This is 
usually a symlink;
  - libfoo.so is used when linking programs. It is supposed to be a 
symlink that points to the latest installed version of the library.

	Note that you can type "sudo ldconfig" to regenerate the missing 
symlinks.

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20090923/42b1e8b7/attachment.pgp>


More information about the Digitalmars-d-learn mailing list