Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / security / cryptography

Building 64-bit Version of the crypto++ DLL

4.83/5 (4 votes)
8 Sep 2014CPOL 15K  
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.

Image 1

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

Image 2

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

Image 3

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)