[so] [ tema 2 ] Legare biblioteca partajata la aplicatie
Dragos Tarcatu
tarcatu_dragosh at yahoo.com
Thu Mar 24 15:42:45 EET 2011
Modifica si targetul de build bin la modul:
bin: main.o
g++ -L. -lcrypto main.o -o bin
Dragos
________________________________
From: lupescu <lupescu_grigore at hotmail.com>
To: so at cursuri.cs.pub.ro
Sent: Thu, March 24, 2011 3:35:29 PM
Subject: Re: [so] [ tema 2 ] Legare biblioteca partajata la aplicatie
Nup, tot "no reference". Ca idee incercasem si doar cu gcc sa compilez si tot
tipa.Incercasem sa ma mai joc si cu pozitionarea partii de legare a librariei
dar am avut erori de genul "does not exist", hence
o vede dar aparent nu gaseste functia respectiva.
Deci am asa :
///////////////////////////////////////////////////
Makefile
//////////////////////////////////////////////////
CFLAGS = -Wall -W
make: clean bin
bin: main.o
g++ -Wl,-rpath -llibcrypto -L. main.o -o bin
main.o: main.cpp
g++ -c main.cpp $(CFLAGS)
clean:
rm -f bin
rm -f *.o
///////////////////////////////////////////////////
main.cpp
//////////////////////////////////////////////////
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
int crypt_des(void *in, int len, void *out);
#ifdef __cplusplus
}
#endif
int main(void)
{
crypt_des(NULL,0,NULL);
printf("E ok\n");
return 0;
}
_______________________________________________
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/ae9b9d9d/attachment.htm>
More information about the so
mailing list