Operating System - HP-UX
1758032 Members
2279 Online
108866 Solutions
New Discussion юеВ

Re: aCC -l, which library is choosen by default? .sh or .a

 
Favreau Cyrille
Occasional Contributor

aCC -l, which library is choosen by default? .sh or .a

Hi all,

The aCC documentation says that Arguments of the form -lx cause the linker to search the library libx.sl or libx.a in an attempt to resolve currently unresolved external references...

Which one is chosen if both files are present in the /usr/lib directory?

I am a bit confused :-/

Thanks for any help :-D
Cyrille
cyrille_favreau
3 REPLIES 3
Stefan Farrelly
Honored Contributor

Re: aCC -l, which library is choosen by default? .sh or .a


I cant say for sure, but I always thought it was .sl first
Im from Palmerston North, New Zealand, but somehow ended up in London...
Mike Stroyan
Honored Contributor

Re: aCC -l, which library is choosen by default? .sh or .a

The default is to use a shared library if both a shared and an archive library are found in the same directory. Ld won't look in additional directories for a shared library if it finds an archive library in the search path.
You can modify the behavior with the ld -a option (or -Wl,-a, for passing through a compiler). See "man ld" for a discussion of
archive, shared, archive_shared, and shared_archive search orders.
Favreau Cyrille
Occasional Contributor

Re: aCC -l, which library is choosen by default? .sh or .a

Thanks for your help guys!! Really appreciated :-D
cyrille_favreau