[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] automake/conf og statiske biblioteker



On Tue, Oct 19, 2004 at 07:17:35AM +0200, sslug@sslug wrote:
> On Mon, 18 Oct 2004, Peter Maersk-Moller wrote:
> 
> > Hej
> > 
> > sslug@sslug wrote:
> > > Det er faktisk også muligt at lave et dynamisk lib fra et statisk, hvis 
> > > jeg husker korrekt. Det er lidt tricky, men jeg har noget kode et sted der 
> > > gør det.
> > 
> > Hvis man oensker at lave libXv.a om til libXv.so, saa virker foelgende:
> > 
> >   # ld --whole-archive -shared -o libXv.so libXv.a
> 
> Wow! Det er godt nok noget simplere end det jeg havde - har ld altid
> kunnet det?

Der er en lille detalje (ikke sikkert det er relevant her, men nu kan
jeg lige så godt sige det alligevel):

Hvis ikke dine objekt filer (der ligger i .a filen) er compilet med
-fPIC option på gcc (position independent code), vil du ikke kunne linke
mod dem dynamisk.   Om ld stadig vil generere en .so ved jeg ikke, men
.so filen vil ihvertfald ikke kunne fungere efter hensigten.

ld er smart, men den kan ikke trylle  ;)

Det kan godt være at .o filerne i .a filen er compilet med -fPIC - det
vil nemlig virke fint nok - men, hvis ikke de er, kan det altså være en
forklaring på hvis din .so fil ikke virker (når du laver den på den
måde).

-- 

 / jakob



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *