<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Modifica headerul crypto.h la modul urmator:<br><br>/*<br> * crypto.h<br> * <br>[...]<br> *<br> */<br><br><br>#ifdef __cplusplus<br>extern "C" {<br>#endif<br><br>int crypt_base64(void *in, int len, void *out);<br><br>[...]<br><br>#ifdef __cplusplus<br>}<br>#endif<br><br>Are de a face cu procesul de name mangling din C++.<br><br>Dragos<div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> lupescu <lupescu_grigore@hotmail.com><br><b><span style="font-weight: bold;">To:</span></b> so@cursuri.cs.pub.ro<br><b><span style="font-weight: bold;">Sent:</span></b>
Thu, March 24, 2011 2:54:18 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [so] [ tema 2 ] Legare biblioteca partajata la aplicatie<br></font><br>Am probleme la compilare folosind biblioteca partajata.<br>Includ header-ul crypto.h si creez obiectul main.o .Cand incerc sa creez <br>executabilul primesc <br>main.cpp:(.text+0x47): undefined reference to `crypt_des(void*, int, void*)'<br><br>Comanda folosita este<br>g++ -Wl,-rpath -llibcrypto -L. main.o -o bin <br><br>In alte situatii (la folosirea altor biblioteci *.so - nu la tema) nu am avut <br>probleme. Sa incarc biblioteca la runtime nu am incercat [1].<br><br>[1] <a href="http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html" target="_blank">http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html</a><br><br><br>_______________________________________________<br><a href="http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii"
target="_blank">http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii</a><br></div></div>
</div><br>
</body></html>