Integrate CryptoPP into a C++ and C++/CLI (CLR) project.

323 views
Skip to first unread message

HD

unread,
May 2, 2016, 3:11:49 AM5/2/16
to Crypto++ Users

I am currently working on a project in Visual Studio 2015, the solution contains 3 main project, a C++ project with backend/business code, a middleware layer that is C++/CLI which is supposed to connect the C++ project with the GUI (which is a WPF C# application).

In the c++ project, I am able to include crypto++ using NuGet, and I am able to use this library just fine - including building this project. However when I try to build the C++/CLI project which includes files/classes from the c++ project I get the error message that the C++/CLI project cannot include "cryptopp\sha.h". How can I get the C++/CLI project to build while including crypto++ in the c++ project?

Just some extra information if needed: the C++ project is included as a reference in the C++/CLI project, and the h file includes are included as a relative paths. For example: in cpp project might contain a class A, with the files A.h and A.cpp, the C++/CLI project that uses class A includes the .h file using: #include "..\cpp\A.h" which does not work is A.h contains:

#include "cryptopp\sha.h"

The line above gives me a compiler error: Error LNK1104 cannot open file 'md/cryptlib.lib'
Removing that line makes the project compile just fine.

I've also tried adding my projects to the CryptoPP project I downloaded manually from the website of CryptoPP, but I get this error now; "LINK : fatal error LNK1104: cannot open file 'D:\Projects\(projectname)\cryptpp563\Debug.obj'", and Debug.obj do not exist in this folder.

Jeffrey Walton

unread,
May 2, 2016, 4:01:23 AM5/2/16
to Crypto++ Users

Just some extra information if needed: the C++ project is included as a reference in the C++/CLI project, and the h file includes are included as a relative paths. For example: in cpp project might contain a class A, with the files A.h and A.cpp, the C++/CLI project that uses class A includes the .h file using: #include "..\cpp\A.h" which does not work is A.h contains:

#include "cryptopp\sha.h"

The line above gives me a compiler error: Error LNK1104 cannot open file 'md/cryptlib.lib'
Removing that line makes the project compile just fine.


'md/cryptlib.lib' (or 'cryptlib.lib') are not a Crypto++ library names.

Perhaps the NuGet folks gave you Gutmann's Cryptlib (http://www.cs.auckland.ac.nz/~pgut001/cryptlib/) or something from OpenSSL?

Jeff
Reply all
Reply to author
Forward
0 new messages