[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
 

SV: [TEKNIK] Problemer med lænkning







>________________________________
> Fra: Robert Larsen <sslug@sslug>
>
>Jeg prøver at compile noget kode, som benytter SHA256 funktionerne fra
>openssl/sha.h, men jeg kan sgi ikke få det til at lænke:
>
>$ make
>cc `pkg-config --libs --cflags libssl` -o hash hash.c
>/tmp/ccZoqZAW.o: In function `check_hash':
>hash.c:(.text+0x31): undefined reference to `SHA256_Init'
>hash.c:(.text+0x4f): undefined reference to `SHA256_Update'
>hash.c:(.text+0x65): undefined reference to `SHA256_Final'
>collect2: error: ld returned 1 exit status
>make: *** [hash] Error 1
>
>[...]
>
>...og hvis jeg lister dens symboler, så ligger funktionerne der:
>$ objdump -T
>/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libcrypto.so|grep
>SHA256
>0000000000068640 g    DF .text    000000000000000a  OPENSSL_1.0.0
>SHA256_Transform
>0000000000068330 g    DF .text    00000000000000e2  OPENSSL_1.0.0
>SHA256_Init
>0000000000068420 g    DF .text    000000000000020f  OPENSSL_1.0.0
>SHA256_Update
>0000000000068830 g    DF .text    0000000000000078  OPENSSL_1.0.0 SHA256
>0000000000068650 g    DF .text    00000000000001c7  OPENSSL_1.0.0
>SHA256_Final
>
>Ved nogen, hvad jeg gør galt?
>
>
Hej Robert,

Nu ved jeg ikke hvordan hash.c ser ud så det er bare et par skud i tågen herfra.

Hvis du vil bruge .so filen lyder det til at du vil linke dynamisk. Plejer man så ikke at skulle have "-ldl" med i cc kommandoen - og måske også "-rdynamic" ?

Eller mangler du at installere -dev pakken ? Hos mig er "libcrypto.a" i "libssl-dev" pakken.

Mvh
-- Jan


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2012-12-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] *