This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Query related to library linking.


Hi,

I have a basic query related to linking of static and dynamic libraries.

My program needs to use 'libcrypto', libssl and libnetsnmp libraries.
Out of these, the libnetsnmp and libssl have dependency on libcrypto.
For some reason, I need to link the libcrypto and libssl statically to my program.
So I have built libcrypto.a and libssl.a and I am able to link them correctly.

But when libnetsnmp gets linked, since it is a shared object, it also links libcrypto.so.
So why should libnetsnmp again try to link libcrypto.so when the symbols are already resolved while statically linking libcrypto.a?
Is there some way to avoid it? I tried using -static and -Bstatic.

Any advice on this will be appreciated.

--
Thanks,
Nilesh
P.S. : I tried looking for any clue in archives. Please redirect me to the link, if such queries are already answered.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]