Re: shared library name resolution

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 16 Jun 2006 07:26:37 -0700, Ulrich Drepper wrote:

> Rex Dieter wrote:
> 
>> Avoid unresolved symbols in your shared library.  Instead of
>> linking -lrt -lssl in your apps, add -lrt -lssl when creating the library,
>> ie, instead of
>> gcc -shared $(CPPFLAGS) -o $(TARGET) $(OBJ)
>> do
>> gcc -shared $(CPPFLAGS) -o $(TARGET) $(OBJ) -lrt -lssl
> 
> 
> Or use
> 
>   gcc -shared $(CPPFLAGS) -o $(TARGET) $(OBJ) -Wl,--as-needed -lrt -lssl
> -Wl,--no-as-needed
> 
> 
> (one long line).
> 
> -- 
> Ulrich Drepper Red Hat, Inc. 444 Castro St Mountain View, CA

The first suggestion works, but the second does not:

   LIBS = -Wl,--as-needed -lrt -lssl -Wl,--no-as-needed

   $(TARGET): $(OBJS)
      gcc -shared $(CPPFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

Wherein do I err?
Thanks,
Mike.





[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux