egcs-1.1b/Solaris 2.5.1: problems with version numbers in dynamic libraries
Dimitri PAPADOPOULOS-ORFANOS
papadopo@shfj.cea.fr
Tue Sep 8 09:29:00 GMT 1998
I have problems using dynamic libraries with version numbers.
Here is a small exeample with a dynamic library "library"
version 1.0 and a program "exe" which tries to use it:
% g++ -fpic -c exe.cc
% g++ -fpic -c library.cc
% g++ -shared -o liblibrary.so.1.0 library.o
% ln -s liblibrary.so.1.0 liblibrary.so
% g++ -o exe exe.o -L/home/papadopo/TOTO -llibrary
%
The problem is that "exe" is linked against "liblibrary.so"
instead of "liblibrary.so.1.0":
% ldd exe
liblibrary.so => ./liblibrary.so
[...]
%
This was not the case with egcs-1.0.2:
% ldd exe
liblibrary.so.1.0 => ./liblibrary.so.1.0
[...]
%
The program won't run unless "liblibrary.so" is in the
LD_LIBRARY_PATH. "liblibrary.so.1.0" won't do.
Is this a bug? Am I missing something?
More information about the Gcc-bugs
mailing list