Can anyone please help me to get up and running with Visual Studio?

26 views
Skip to first unread message

vem...@gmail.com

unread,
Mar 27, 2018, 2:15:27 PM3/27/18
to Crypto++ Users
Hi all,

Previously all my c++ development was in Netbeans/cygwin/gcc/gdb combo or Qt Designer where I added \cryptopp to lib path after compiling the library and everything worked fine. But recent quirks of the former bundle are pushing me to abandon Netbeans for Visual Studio.
After installing Universal runtime into VS 2017 and successfully compiling Cryptlib, how do I reference it from my VS projects? I tried adding \cryptopp\Win32\Output\Debug\ to the lib path of the project properties, but VS still threw 121 unresolved symbol errors such as 

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: __thiscall CryptoPP::Algorithm::Algorithm(bool)" (??0Algorithm@CryptoPP@@QAE@_N@Z) referenced in function "public: __thiscall CryptoPP::AsymmetricAlgorithm::AsymmetricAlgorithm(void)" (??0AsymmetricAlgorithm@CryptoPP@@QAE@XZ)
Error LNK2001 unresolved external symbol "public: virtual bool __thiscall CryptoPP::HashTransformation::TruncatedVerify(unsigned char const *,unsigned int)" (?TruncatedVerify@HashTransformation@CryptoPP@@UAE_NPBEI@Z)
Error LNK2001 unresolved external symbol "public: virtual unsigned char __thiscall CryptoPP::RandomNumberGenerator::GenerateByte(void)" (?GenerateByte@RandomNumberGenerator@CryptoPP@@UAEEXZ)
Error LNK2001 unresolved external symbol "public: virtual unsigned int __thiscall CryptoPP::RandomNumberGenerator::GenerateBit(void)" (?GenerateBit@RandomNumberGenerator@CryptoPP@@UAEIXZ)
Error LNK2001 unresolved external symbol "public: virtual unsigned int __thiscall CryptoPP::RandomNumberGenerator::GenerateWord32(unsigned int,unsigned int)" (?GenerateWord32@RandomNumberGenerator@CryptoPP@@UAEIII@Z)


What am I doing wrong?

Thank you!
ZV

Marcel Raad

unread,
Mar 27, 2018, 2:41:57 PM3/27/18
to vem...@gmail.com, Crypto++ Users
Hi,


<vem...@gmail.com> schrieb am Di., 27. März 2018, 20:15:
After installing Universal runtime into VS 2017 and successfully compiling Cryptlib, how do I reference it from my VS projects? I tried adding \cryptopp\Win32\Output\Debug\ to the lib path of the project properties, but VS still threw 121 unresolved symbol errors such as

you also have to add the library name under Linker -> Input -> Additional Dependencies.

Marcel

vem...@gmail.com

unread,
Mar 27, 2018, 2:54:49 PM3/27/18
to Crypto++ Users
Thank you, that allowed me to advance one step further, but now I get lots of this: 

Severity Code Description Project File Line Suppression State
Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in test1.obj test1 C:\Users\user1\Documents\Visual Studio 2017\Projects\pciencryption\pciencryption\cryptlib.lib(cryptlib.obj) 1
 ...
Error LNK2005 "public: bool __thiscall std::ios_base::good(void)const " (?good@ios_base@std@@QBE_NXZ) already defined in cryptlib.lib(cryptlib.obj) test1 C:\Users\user1\Documents\Visual Studio 2017\Projects\pciencryption\pciencryption\msvcprtd.lib(MSVCP140D.dll) 1

Jeffrey Walton

unread,
Mar 27, 2018, 2:59:05 PM3/27/18
to Crypto++ Users

Probably mixing and matching runtime libraries.

Also see https://www.cryptopp.com/wiki/Visual_Studio#Dynamic_Runtime_Linking

Jeff

vem...@gmail.com

unread,
Mar 27, 2018, 3:08:24 PM3/27/18
to Crypto++ Users
Yep, that's it - just flipped Mutl-threaded debug DLL to Multi-threaded debug and it worked.

Thanks a lot, much appreciated!
ZV
 
Reply all
Reply to author
Forward
0 new messages