[so] [ tema 2 ] Legare biblioteca partajata la aplicatie

Dragos Tarcatu tarcatu_dragosh at yahoo.com
Thu Mar 24 15:26:42 EET 2011


Modifica headerul crypto.h la modul urmator:

/*
 *  crypto.h
 *  
[...]
 *
 */


#ifdef __cplusplus
extern "C" {
#endif

int crypt_base64(void *in, int len, void *out);

[...]

#ifdef __cplusplus
}
#endif

Are de a face cu procesul de name mangling din C++.

Dragos




________________________________
From: lupescu <lupescu_grigore at hotmail.com>
To: so at cursuri.cs.pub.ro
Sent: Thu, March 24, 2011 2:54:18 PM
Subject: [so] [ tema 2 ] Legare biblioteca partajata la aplicatie

Am probleme la compilare folosind biblioteca partajata.
Includ header-ul crypto.h si creez obiectul main.o .Cand incerc sa creez 
executabilul primesc 
main.cpp:(.text+0x47): undefined reference to `crypt_des(void*, int, void*)'

Comanda folosita este
g++  -Wl,-rpath -llibcrypto -L. main.o -o bin 

In alte situatii (la folosirea altor biblioteci *.so - nu la tema) nu am avut 
probleme. Sa incarc biblioteca la runtime nu am incercat [1].

[1] http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html


_______________________________________________
http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20110324/93f7ddff/attachment.htm>


More information about the so mailing list