[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] hjælp til dynamisk library med gcc.



On 2011-02-21, Martin Møller Skarbiniks Pedersen <sslug@sslug> wrote:
> Hejsa,
>
>   Jeg vil gerne lære at lave C libraries.
>   Jeg har prøvet at følge opskriften på
> http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN95
> uden held.
>
> Kan nogle hjælpe udfra nedenstående ?
>
> $ make
> gcc -Wall -ansi -Werror -fPIC -c martinlib.c
> gcc -shared -Wl,-soname,libmartin.so.1 -o libmartin.so.1.0 martinlib.o -lc

Hvorfor har du .so.1 som soname, og libmartin.so.1.0 som filnavn ?

/Sune

> $ make example
> gcc -o example example.c -lmartin
> /usr/bin/ld: cannot find -lmartin
> collect2: ld returned 1 exit status
> make: *** [example] Error 1

-lfoo leder efter libfoo.so i relevante mapper.

/Sune


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-03-01, 02:01 CET [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] *