Problem building and using Crypto++ on Windows (Visual Studio)

368 views
Skip to first unread message

jensmue...@gmail.com

unread,
Mar 14, 2017, 1:45:26 PM3/14/17
to Crypto++ Users
Hi, 

I'd like to build and use Crypto++ on Windows (64bit).

So far I used VisualStudio 2012 to compile Crypto++ 5.6.5 to generate the static libary cryptlib.lib. According to the output, this should have completed successfully.
I set up a simple project in VistualSutio 2012 (I used this AES encryption code), included the header files and gave a refrences to the cryptlib.lib file.

However, when compiling errors of the following form appear:
"error LNK2001: unresolved external symbol ""protected: virtual void __thiscall CryptoPP::CBC_Decryption::ResizeBuffers(void)" (?ResizeBuffers@CBC_Decryption@CryptoPP@@MAEXXZ)". "

Does this mean that definitions / implemenations for some header files are missing? Does more than the cryptlib.lib file have to be included?
Or can you maybe spot a mistake in how I set up the project / created the cryptlib.lib file?

I gave a detailed step-by-step instruction of what I did in this github issue.

It would be great if someone could help me.

Best regards

Jeffrey Walton

unread,
Mar 14, 2017, 7:33:23 PM3/14/17
to Crypto++ Users

So far I used VisualStudio 2012 to compile Crypto++ 5.6.5 to generate the static libary cryptlib.lib. According to the output, this should have completed successfully.
I set up a simple project in VistualSutio 2012 (I used this AES encryption code), included the header files and gave a refrences to the cryptlib.lib file.

However, when compiling errors of the following form appear:
"error LNK2001: unresolved external symbol ""protected: virtual void __thiscall CryptoPP::CBC_Decryption::ResizeBuffers(void)" (?ResizeBuffers@CBC_Decryption@CryptoPP@@MAEXXZ)". "


Go to Start -> Programs -> Visual Studio 2012 -> Developer Tools. Open a VS2012 x64 Command Prompt. 'cd' to you Crypto++ project. Then, issue

    msbuild /t:Build /p:Configuration=Debug;Platform=x64 <your project>.vcxproj

Copy/paste the output into this question.

Also see https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx and https://www.cryptopp.com/wiki/MSBuild_(Command_Line).

Jeff

seekM

unread,
Mar 15, 2017, 9:49:56 AM3/15/17
to Crypto++ Users
Thank you Jeff.

Executing your command let me to the error "x64 build: error MSB8013: This project doesn't contain the Configuration and Platform combination of Debug|Win32".

ConsoleApplication was created with the x32 platform as a default. I had  to right-click on the project and then "properties > configuration manager" and at "platform" change x32 to x64. Also, at "Properties > Configuration Properties > VC++ Directories >Library Directories" there was "$(WindowsSDK_LibraryPath_x86)" which I had to delete and check the box that all properties shall to be inherited. At "Properties > Configuration Properties > C/C++ > Code Generation > Runtime Library" I had to switch to MT.

I am now able to build and run the sample application with both the x32 and x64 platform (using cryptlib.lib at Win32\Output\Release and x64\Output\Release respectively).

Thank you!

Best regard
Tobias
Reply all
Reply to author
Forward
0 new messages