65.9K
CodeProject is changing. Read more.
Home

Building 64-bit Version of the crypto++ DLL

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.83/5 (4 votes)

Sep 8, 2014

CPOL
viewsIcon

15012

This tip shows you how to compile crypto++ for 64-bit environment.

Introduction

It is to solve your problem on using crypto++ library in 64bit environment. The 32bit build works fine, but though building a 64bit release of this library compile sucessfully, using this library in other projects shows unusual link errors.

You may face such kind of errors:

1>cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol Baseline_Add
1>cryptlib.lib(integer.obj) : error LNK2001: unresolved external symbol Baseline_Sub
1>cryptlib.lib(sha.obj) : error LNK2001: unresolved external symbol X86_SHA256_HashBlocks
1>cryptlib.lib(rijndael.obj) : error LNK2001: unresolved external symbol Rijndael_Enc_AdvancedProcessBlocks

Such linker errors are caused because we miss compiling the assembly level code present in the crypto++ library.

If you check the files in crypto++ library, you can see x64dll.asm and x64masm.asm files which are assembly level codes and are missed to be compiled by C++ compiler.

Compiling Assembly Code

We can customize the build of crypto++ library by adding masm (.targets, .props) in Build Customizations feature in Visual Studio 2010.

Right click The Crypto++ project and select "Build Costumizations".

Select and check the checkbox with "masm (.targets, .props)" and press OK.

Rebuild the crypto++ library and it will be link error free when you use it in other projects as in the picture MainProject.

Thank you for reading.