Well, spoke too soon. I'm getting some linker errors that I just can't
figure out. Logically, since I'm linking with cryptopp.lib, you'd think
they wouldn't occur. Here's the header and cpp files that I'm compiling
followed by the errors.
I'm using MSVC 6.0 Pro with SP5.
I'm very new to template-based programming, so please be kind. :)
Encryption.h
#ifndef __ENCRYPTION_H
#define __ENCRYPTION_H
#include "filters.h"
#include <string>
using namespace std;
using namespace CryptoPP;
string RSADecryptString(const char *privFilename, const char *ciphertext);
#endif
Encryption.cpp
#include "stdafx.h"
#include "Encryption.h"
#include "hex.h"
#include "sha.h"
#include "rsa.h"
#include <iostream>
USING_NAMESPACE(CryptoPP)
USING_NAMESPACE(std)
string RSADecryptString(const char *privFilename, const char *ciphertext)
{
StringSource privFile(privFilename, true, new HexDecoder);
RSAES_OAEP_SHA_Decryptor priv(privFile);
string result;
StringSource(ciphertext, true,
new HexDecoder(newPK_DecryptorFilter(priv,
new StringSink(result))));
return result;
}
Everything compiles fine... the linker however...
Linking...
Encryption.obj : error LNK2001: unresolved external symbol "private:
static int const * __cdecl
CryptoPP::HexDecoder::GetDecodingLookupArray(void)"
([EMAIL PROTECTED]@CryptoPP@@CAPBHXZ)
Encryption.obj : error LNK2001: unresolved external symbol "void __cdecl
CryptoPP::BERDecodeNull(class CryptoPP::BufferedTransformation &)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@Z)
Encryption.obj : error LNK2001: unresolved external symbol "void __cdecl
CryptoPP::DEREncodeNull(class CryptoPP::BufferedTransformation &)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@Z)
Encryption.obj : error LNK2001: unresolved external symbol "void __cdecl
CryptoPP::AssignIntToInteger(void *,void const *)"
([EMAIL PROTECTED]@@[EMAIL PROTECTED])
Incidentally, the cryptest.exe test application compiles fine; so to date,
I have no idea what the difference is.
Thanks for any help.
> Thanks Wei Dai! I had to do some re-learning, but when I realized that I
> could replace a FileSource with a StringSource using practically the same
> format as in test.cpp, I was good to go!
>
> I was almost at wits end when I finally saw the correlation between the
> two classes. It saved me a little time (i.e. didn't have to wait for a
> reply), and I just wanted to share my thanks and discovery.
>
>
--
Brian