Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Linking with .so library without prefix

62 views
Skip to first unread message

rt15

unread,
Jun 5, 2009, 1:12:37 PM6/5/09
to
Hi (And sorry for my horrible english),

I compile a foo.so shared library, without the lib prefix.

Then I want to link it with a program (using aix ld/aix compiler).

Today it is done by simply put foo.so on the command line, without
using the -l option.
As foo.so is in the current directory, it is found and the library is
loaded succefully at runtime.

However, it won't be anymore possible because I don't want to have
binaires in the current directory (And no ln -s links too...)

But if I link with /somedir/foo.so on the command line, foo.so is not
found at execution time (Because it search for /somedir/foo.so, not
just foo.so).

I cannot use -l option because it search for libfoo.so...

On other platforms, I use the -soname (Or -h or +h...) option which
don't exists on aix.
I also sometimes use a particular -l option variant of gnu ld:
-l:foo.so
The column tells the linker to search for the exact name, so it don't
add the lib prefix.

-blibsuff allow to select suffix (.so...). The same option but for the
prefix would be great for me.
Where could I found the aix ld documentation ???

Thanks in advance.

Gary R. Hook

unread,
Jun 6, 2009, 9:50:06 AM6/6/09
to
rt15 wrote:
> Where could I found the aix ld documentation ???

The linker documentation is in the pubs, along with everything else.

You can try staring here:

http://www14.software.ibm.com/webapp/set2/sas/f/genunix3/productdocs.html

You want to understand the -L, -blibpath and especially the -bnoipath
options.

--
Gary R. Hook
________________________________________________________________________
Vocatus atque non vocatus deus aderit

rt15

unread,
Jun 8, 2009, 3:34:41 AM6/8/09
to
-bnoipath was exactly what I search for.
Thank you very much for this quick and effective response ! I love
you !
0 new messages