RE: unresolved external .NET 2003

37 views
Skip to first unread message

Seshu Madabushi

unread,
Mar 9, 2004, 12:38:05 PM3/9/04
to crypto...@eskimo.com
Compile it as _stdcall, had the same problems


Walton, Jeffrey

unread,
Mar 9, 2004, 12:43:36 PM3/9/04
to crypto...@eskimo.com
Hello Lennart,

See if the following thread helps.

http://www.escribe.com/software/crypto/m3450.html

Jeff

> -----Original Message-----
> From: cryptopp-l...@eskimo.com
> [mailto:cryptopp-l...@eskimo.com] On Behalf Of Lennart Lopin
> Sent: Tuesday, March 09, 2004 12:13 PM
> To: crypto...@eskimo.com
> Subject: unresolved external .NET 2003
>
>
> Hello @ all,
>
> I am new to Crypto++ and tried to compile my first CPP
> project with Visual .NET 2003 - unfortunately i get
> "unresolved external" errors. Here is my code:
>
> #include "stdafx.h"
> #include <stdlib.h>
> #include <stdio.h>
> #include "CryptoPP/cryptlib.h"
> #include "CryptoPP/des.h"
> #include "CryptoPP/modes.h"
>
> //#include "CryptoPP/filters.h"
> using namespace CryptoPP;
>
> int _tmain(int argc, _TCHAR* argv[])
> {
> DES::Encryption des;
> return 0;
> }
>
> As you can see, i simply tried to initialize a des
> object. But even then i get the following errors:
>
> Linking...
> DesEncrypter.obj : error LNK2001: unresolved external
> symbol "public: virtual void __thiscall
> CryptoPP::BlockTransformation::ProcessAndXorMultipleBlocks(unsigned
> char const *,unsigned char const *,unsigned char
> *,unsigned int)const "
> (?ProcessAndXorMultipleBlocks@BlockTransformation@CryptoPP@@UB
> EXPBE0PAEI@Z)
> DesEncrypter.obj : error LNK2001: unresolved external
> symbol "public: virtual void __thiscall
> CryptoPP::DES::Base::ProcessAndXorBlock(unsigned char const
> *,unsigned char const *,unsigned char *)const "
> (?ProcessAndXorBlock@Base@DES@CryptoPP@@UBEXPBE0PAE@Z)
> DesEncrypter.obj : error LNK2019: unresolved external
> symbol "public: __thiscall CryptoPP::Algorithm::Algorithm(bool)"
> (??0Algorithm@CryptoPP@@QAE@_N@Z) referenced in
> function "public: __thiscall
> CryptoPP::BlockTransformation::BlockTransformation(void)"
> (??0BlockTransformation@CryptoPP@@QAE@XZ)
> DesEncrypter.obj : error LNK2019: unresolved external
> symbol "public: void __thiscall
> CryptoPP::DES::Base::UncheckedSetKey(enum
> CryptoPP::CipherDir,unsigned char const *,unsigned
> int)"
> (?UncheckedSetKey@Base@DES@CryptoPP@@QAEXW4CipherDir@3@PBEI@Z)
> referenced in function "void __cdecl
> CryptoPP::CheckedSetKey<class CryptoPP::BlockCipherTemplate<0,class
> CryptoPP::DES::Base> >(class CryptoPP::BlockCipherTemplate<0,class
> CryptoPP::DES::Base> *,enum
> CryptoPP::CipherDir,unsigned char const *,unsigned
> int,class CryptoPP::NameValuePairs const &)"
> (??$CheckedSetKey@V?$BlockCipherTemplate@$0A@VBase@DES@CryptoP
> P@@@CryptoPP@@@CryptoPP@@YAXPAV?$BlockCipherTemplate@$0A@VBase
> @DES@CryptoPP@@@0@W4CipherDir@0@PBEIABVNameValuePairs@0@@Z)
> DesEncrypter.obj : error LNK2019: unresolved external
> symbol "protected: void __thiscall
> CryptoPP::SimpleKeyingInterface::ThrowIfInvalidKeyLength(class
> CryptoPP::Algorithm const &,unsigned int)"
> (?ThrowIfInvalidKeyLength@SimpleKeyingInterface@CryptoPP@@IAEX
> ABVAlgorithm@2@I@Z)
> referenced in function "public: void __thiscall
> CryptoPP::SimpleKeyedTransformation<class
> CryptoPP::BlockTransformation>::ThrowIfInvalidKeyLength(unsigned
> int)"
> (?ThrowIfInvalidKeyLength@?$SimpleKeyedTransformation@VBlockTr
> ansformation@CryptoPP@@@CryptoPP@@QAEXI@Z)
> Debug/DesEncrypter.exe : fatal error LNK1120: 5
> unresolved externals
>
> I would appreciate any hint on what causes this
> unresolved external error,
>
> regards,
>
> Lennart
>
>
>
>
>
>
> Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de
>

Lennart Lopin

unread,
Mar 10, 2004, 6:31:07 AM3/10/04
to crypto...@eskimo.com
Dear Jeffrey & Seshu,

Unfortunately it did not work. I changed the calling
convention to _stdcall. Changed from debug mode to
release mode and made sure that my project links
statically. Somehow i still get the unresolved error.

When i compile the same project under VC6 i get the
same unresolved external error...

Some other idea?

Walton, Jeffrey

unread,
Mar 10, 2004, 12:01:10 PM3/10/04
to crypto...@eskimo.com
Hi Lennart,

That the problem occurs with VC++ 6.0 makes me believe the files are not
on path.

In VC++ 6.0, Select Tools->Options, Directories. Are the headers,
source, and library files directories included?

Jeff

Jeffrey Walton
Maryland DDS
410-308-4441
jeffrey...@ssa.gov

> -----Original Message-----
> From: cryptopp-l...@eskimo.com
> [mailto:cryptopp-l...@eskimo.com] On Behalf Of Lennart Lopin

Lennart Lopin

unread,
Mar 10, 2004, 1:04:48 PM3/10/04
to crypto...@eskimo.com
Hello Jeffrey,

Thanks for your help! At least for VC6 it was a path
issue and i got it working using the "dlltest" project
as a starting point.

This being solved, i have another question, which is
related to Java<->CryptoC++ compatability for 3DES
(CBC mode, PKCS5 Padding) symmetric encryption.

My Java-encrypted string looks totally different from
the same string encrypted with Crypto++. I tried all
kinds of combinations but somehow they dont match. Is
there anyone who ever tried to encrypt/decrypt with
Java/C++ successfully? (I read and compiled this:
http://www.escribe.com/software/crypto/m3244.html
sample, but although both functions are "equivalent"
they dont produce the same result - at least for me")

any hints are welcome!!

regards, Lennart

--- "Walton, Jeffrey" <Jeffrey...@ssa.gov>
schrieb: > Hi Lennart,

> ATTACHMENT part 2 application/x-pkcs7-signature
name=smime.p7s

Lennart Lopin

unread,
Mar 9, 2004, 12:17:32 PM3/9/04
to crypto...@eskimo.com
Hello @ all,

regards,

David C. Partridge

unread,
Mar 11, 2004, 4:26:11 AM3/11/04
to crypto...@eskimo.com
Is the Java code encrypting a Java String or a byte array?

If the former, you're encrypting the Unicode string, if the latter, did you
specify the character set for String.getBytes to be the same encoding as the
data you were encrypting in VC6 (probably CCSID 1252).

David


Reply all
Reply to author
Forward
0 new messages