cryptest.sln failing to build

30 views
Skip to first unread message

Joshua Weadick

unread,
Feb 23, 2021, 6:10:56 AM2/23/21
to Crypto++ Users
Hello,

I am trying to get started with the crypto++ library and am having trouble with Visual Studio 2019 with Crypto++ 8.4. When I open the cryptest.sln file it builds fine, but when I run it, it fails and throws an exception in the file Integer.cpp. in the class a_times_b_mod_c(). 

I've tried downloading version 8.3 and running that as well and I'm still getting the same issue and would greatly appreciate any feedback on why this may be happening.

Robert Roessler

unread,
Feb 23, 2021, 2:26:58 PM2/23/21
to Crypto++ Users
I just built the cryptest.sln with VS 2019 16.8.6 (an "x64 Release" build), ran "cryptest.exe v", and received the following:

All tests passed!

Seed used was 1614107451
Test started at Tue Feb 23 11:10:51 2021
Test ended at Tue Feb 23 11:10:58 2021


What did you do [differently]?

Jeffrey Walton

unread,
Feb 23, 2021, 4:51:18 PM2/23/21
to Crypto++ Users List
The assert is https://github.com/weidai11/cryptopp/blob/master/integer.cpp#L4397.
The particular test that is failing is this one:
https://github.com/weidai11/cryptopp/blob/master/validat2.cpp#L686.

The assert is expected when running the test suite in a debug build.

The assert is present to alert a developer when divide by 0 has
happened. DebugBreak() is called so a developer can inspect the call
stack to see what has gone sideways.

Also see https://www.cryptopp.com/wiki/Assertions.

Jeff

Joshua Weadick

unread,
Feb 23, 2021, 5:51:40 PM2/23/21
to Crypto++ Users
Ah I see, once I ran without debugging it is passing all tests! However I am still having trouble actually integrating the library into my project as when I build it, it throws LNK2001 and LNK2019 errors whenever I try to reference any classes or functions within the crypto++ library. I added the path to cryptlib.h in my Additional Include Directories so I'm very confused on why I'm unable to compile properly. Do I need to rebuild the cryptest.sln within the current project I'm working on? And if so, how then do I debug my own code rather than running the cryptest.sln code every time I try to run my code?

Apologies for what may be simple questions, I've been coding using g++ and gdb for my lower level classes the past 2 years but now I'm in my upper-divs and we have to use Visual Studio so I'm still getting the hang of the functionality as a whole.

Best,

Josh Weadick

Jeffrey Walton

unread,
Feb 23, 2021, 6:44:28 PM2/23/21
to Crypto++ Users List
On Tue, Feb 23, 2021 at 5:51 PM Joshua Weadick <wea...@usc.edu> wrote:
>
> Ah I see, once I ran without debugging it is passing all tests! However I am still having trouble actually integrating the library into my project as when I build it, it throws LNK2001 and LNK2019 errors whenever I try to reference any classes or functions within the crypto++ library. I added the path to cryptlib.h in my Additional Include Directories so I'm very confused on why I'm unable to compile properly. Do I need to rebuild the cryptest.sln within the current project I'm working on? And if so, how then do I debug my own code rather than running the cryptest.sln code every time I try to run my code?

https://www.cryptopp.com/wiki/Visual_Studio#Runtime_Linking

Jeff
Reply all
Reply to author
Forward
0 new messages