scott-289 wrote:
> 
> Dear scott
> can you help me with specific steps how to link and use the crypto++
> library in my program VS8.0 on windows 7
> 
> i need to use the blowfish and RC5 algorithms in CBC mode, but when i try
> to compile my program i got unresolved external symbols
> 
> my program is as follwos:
> // first.cpp : Defines the entry point for the console application.
> //
> 
> #include "stdafx.h"
> #include <iostream>
> 
> #include <C:\Users\mona_essam\Downloads\crypto++\osrng.h>  //needed for
> AutoSeededRandomPool
> #include <C:\Users\mona_essam\Downloads\crypto++\modes.h>
> #include <C:\Users\mona_essam\Downloads\crypto++\blowfish.h>
> #include <C:\Users\mona_essam\Downloads\crypto++\filters.h>
> 
> using namespace std;
> using namespace CryptoPP;  //the general crapto++ namespace
> 
> int main() {
>               
>     AutoSeededRandomPool rng;
>     string key(Blowfish::DEFAULT_KEYLENGTH, 0);
>     string iv(Blowfish::BLOCKSIZE, 0);// this is the Initialization
> Vecktor
> 
>   //Create a random key as well as a random IV with default sizes (16)
>     rng.GenerateBlock((unsigned char*)key.c_str(),
> Blowfish::DEFAULT_KEYLENGTH);
>     rng.GenerateBlock((unsigned char*)iv.c_str(), Blowfish::BLOCKSIZE);
>               
>     string plain = "This string will be encrypted throug Blowfish!";
>     string encrypted;  //will store the encrypted string
>     string decrypted;  //will store the string after it is decrypted again
> 
>   //Setup the Blowfish Cipher in CBC-Mode
>     Blowfish::Encryption blowEn((unsigned char*)key.c_str(), key.size());
>     CBC_Mode_ExternalCipher::Encryption cbcEn( blowEn, (unsigned
> char*)iv.c_str() );
> 
>   //Put the "plain" string into the cipher and encrypt it to "encrypted
>     StreamTransformationFilter stfEncryptor(cbcEn, new StringSink(
> encrypted ) );
>     stfEncryptor.Put( (unsigned char*)plain.c_str(), plain.size() + 1 );
>     stfEncryptor.MessageEnd();
> 
>   // Decrypt (very analog to the encryption block
>     Blowfish::Decryption blowDe((unsigned char*)key.c_str(), key.size());
>     CBC_Mode_ExternalCipher::Decryption cbcDe( blowDe, (unsigned
> char*)iv.c_str() );
> 
>     StreamTransformationFilter stfDecryptor(cbcDe, new StringSink(
> decrypted ) );
>     stfDecryptor.Put((unsigned char*)encrypted.c_str(), encrypted.size()
> );
>     stfDecryptor.MessageEnd();
> 
>   //Dump "plain"
>     cout << "Plain: "<< endl << plain << endl << endl;
> 
>   //Dump "encrypted" (convert it to hexadecimal numbers for better
> reading)
>     cout << "Encrypted text: " << endl;
>     for( int i = 0; i < encrypted.size(); i++ ) {
>         cout << hex << (0xff & (int)encrypted[i]) << " ";
>     }
> 
>     cout << endl << endl;
> 
>   // Dump Decrypted Text
>     cout << "Decrypted Text: " << endl;
>     cout << decrypted;
>     cout << endl << endl << ":-)" << endl;
> 
>     return 0;
> }
> ===================================
> 
> and the errors are :
> Error 1       error LNK2001: unresolved external symbol "class
> CryptoPP::NameValuePairs const & const CryptoPP::g_nullNameValuePairs"
> (?g_nullNameValuePairs@CryptoPP@@3ABVNameValuePairs@1@B)      
> 
> Error 2       error LNK2001: unresolved external symbol "public: virtual void
> __thiscall CryptoPP::Blowfish::Base::UncheckedSetKey(unsigned char const
> *,unsigned int,class CryptoPP::NameValuePairs const &)"
> (?UncheckedSetKey@Base@Blowfish@CryptoPP@@UAEXPBEIABVNameValuePairs@3@@Z)
> 
> Error 3       error LNK2001: unresolved external symbol "public: virtual void
> __thiscall CryptoPP::Blowfish::Base::ProcessAndXorBlock(unsigned char
> const *,unsigned char const *,unsigned char *)const "
> (?ProcessAndXorBlock@Base@Blowfish@CryptoPP@@UBEXPBE0PAE@Z)
> 
> Please if you can help me , i would be so grateful to you     
>       
>       
> 
> 

-- 
View this message in context: 
http://old.nabble.com/unresolved-external-symbols-tp31460600p32270800.html
Sent from the Crypto++ Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to