rfr je ne sais pour quelle raison, j'avais peut-être bidouillé ton Makefile, mais bref j'ai refait le test et ça marche, lib et exe compris. Cependant ça ne résoud pas mon problème
(puisque moi je parvenais aussi à sortir le libcryptopp.a)
Voici un petit code fait rapidement pour tester la lib :
/*
Prog de test pour la lib Crypto++
Compile: g++ -o hashtest hashtest.cpp -lcrypto++
Site pour tester:
http://serversniff.net/content.php?do=hash*/
#include <iostream>
#include <string>
// à remplacer par <cryptopp/...> sous windows
#include <crypto++/cryptlib.h>
#include <crypto++/sha.h>
using namespace std;
using namespace CryptoPP;
int main() {
string plaintext;
byte sig[ SHA512::DIGESTSIZE ];
cout<<"Chaîne de caractères à hasher: ";
getline(cin, plaintext); // pour saisir des chaînes avec espaces
// appel à la lib Crypto++ pour calculer le hash
SHA512 hash;
hash.CalculateDigest(sig, (byte const *)plaintext.c_str(), plaintext.size());
cout<<"Hash ("<<SHA512::DIGESTSIZE<<" bytes) = ";
for (int i=0; i<SHA512::DIGESTSIZE; i++) cout<<hex<<uppercase<<(int)sig[ i ]<<" ";
cout<<dec<<nouppercase<<endl;
}
Ca marche nickel sous linux
Et sous Windows voici le résultat de la compil :
F:\Olivier\projects\win32progs>g++ -o hashtest.exe hashtest.cpp -lcryptopp
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccGEbaaa.o:hashtest.cpp:(.rdata$_ZTVN8CryptoP
P6SHA512E[vtable for CryptoPP::SHA512]+0x44): undefined reference to `CryptoPP::
IteratedHashBase<unsigned long long, CryptoPP::HashTransformation>::TruncatedFin
al(unsigned char*, unsigned int)'
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccGEbaaa.o:hashtest.cpp:(.rdata$_ZTVN8CryptoP
P31IteratedHashWithStaticTransformIyNS_10EnumToTypeINS_9ByteOrderELi1EEELj128ELj
64ENS_6SHA512ELj64EEE[vtable for CryptoPP::IteratedHashWithStaticTransform<unsig
ned long long, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 128u, 64u, CryptoPP
::SHA512, 64u>]+0x44): undefined reference to `CryptoPP::IteratedHashBase<unsign
ed long long, CryptoPP::HashTransformation>::TruncatedFinal(unsigned char*, unsi
gned int)'
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccGEbaaa.o:hashtest.cpp:(.rdata$_ZTVN8CryptoP
P12ClonableImplINS_6SHA512ENS_13AlgorithmImplINS_12IteratedHashIyNS_10EnumToType
INS_9ByteOrderELi1EEELj128ENS_18HashTransformationEEES1_EEEE[vtable for CryptoPP
::ClonableImpl<CryptoPP::SHA512, CryptoPP::AlgorithmImpl<CryptoPP::IteratedHash<
unsigned long long, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>, 128u, CryptoPP
::HashTransformation>, CryptoPP::SHA512> >]+0x44): undefined reference to `Crypt
oPP::IteratedHashBase<unsigned long long, CryptoPP::HashTransformation>::Truncat
edFinal(unsigned char*, unsigned int)'
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccGEbaaa.o:hashtest.cpp:(.rdata$_ZTVN8CryptoP
P13AlgorithmImplINS_12IteratedHashIyNS_10EnumToTypeINS_9ByteOrderELi1EEELj128ENS
_18HashTransformationEEENS_6SHA512EEE[vtable for CryptoPP::AlgorithmImpl<CryptoP
P::IteratedHash<unsigned long long, CryptoPP::EnumToType<CryptoPP::ByteOrder, 1>
, 128u, CryptoPP::HashTransformation>, CryptoPP::SHA512>]+0x44): undefined refer
ence to `CryptoPP::IteratedHashBase<unsigned long long, CryptoPP::HashTransforma
tion>::TruncatedFinal(unsigned char*, unsigned int)'
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccGEbaaa.o:hashtest.cpp:(.rdata$_ZTVN8CryptoP
P12IteratedHashIyNS_10EnumToTypeINS_9ByteOrderELi1EEELj128ENS_18HashTransformati
onEEE[vtable for CryptoPP::IteratedHash<unsigned long long, CryptoPP::EnumToType
<CryptoPP::ByteOrder, 1>, 128u, CryptoPP::HashTransformation>]+0x44): undefined
reference to `CryptoPP::IteratedHashBase<unsigned long long, CryptoPP::HashTrans
formation>::TruncatedFinal(unsigned char*, unsigned int)'
collect2: ld returned 1 exit status
Help