Compiler question: -blibpath flag usage

Compiler question: -blibpath flag usage

Post by sv » Fri, 28 Jun 2002 19:22:37



Hello,
question about -blibpath flag in C/C++ compiler on AIX.

-blibpath is path for finding shlibs at runtime.
if I compile my program
#cc bla.c -o bla -blibpath:/home/user/mylib:.

I can not run the binary ./bla
because loader can not load module libc.a(shr.o).
As I understand this flag overwrite standart path to
new one for finding shlibs at runtime.

How can I avoid this problem without any environment variables?
so that my application will be able to find all standart libraries and
my libraries at runtime.

Thanks,
Sergej

 
 
 

Compiler question: -blibpath flag usage

Post by Paul Pluzhniko » Sat, 29 Jun 2002 00:02:04



> if I compile my program
> #cc bla.c -o bla -blibpath:/home/user/mylib:.

> I can not run the binary ./bla
> because loader can not load module libc.a(shr.o).
> As I understand this flag overwrite standart path to
> new one for finding shlibs at runtime.

> How can I avoid this problem without any environment variables?
> so that my application will be able to find all standart libraries and
> my libraries at runtime.

   cc bla.c -o bla -blibpath:/home/user/mylib:.:/usr/lib:/lib

Cheers,
--
In order to understand recursion you must first understand recursion.

 
 
 

Compiler question: -blibpath flag usage

Post by Gary R. Hoo » Sat, 29 Jun 2002 02:00:53




> > if I compile my program
> > #cc bla.c -o bla -blibpath:/home/user/mylib:.

> > I can not run the binary ./bla
> > because loader can not load module libc.a(shr.o).
> > As I understand this flag overwrite standart path to
> > new one for finding shlibs at runtime.

> > How can I avoid this problem without any environment variables?
> > so that my application will be able to find all standart libraries and
> > my libraries at runtime.

>    cc bla.c -o bla -blibpath:/home/user/mylib:.:/usr/lib:/lib

The specified libpath should always include every path necessary
for running the application.  That includes system library directories.

--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
________________________________________________________________________