Monero-Pool icon indicating copy to clipboard operation
Monero-Pool copied to clipboard

Error compiling in VS2017:

Open xpat07 opened this issue 7 years ago • 2 comments

Platform-Toolset: Visual Studio 2017 (v141)

C2864 'std::ratio<_Nx,_Dx>::num': a static data member with an in-class initializer must have non-volatile const integral type

xpat07 avatar Nov 03 '17 16:11 xpat07

Hi, use vs 2012. I got it to build and run. However see issue 3 on this thread - was the result (stack overflow) Code is broken, grr

JamieShelley avatar Nov 18 '17 21:11 JamieShelley

The error is due to the keyword constexpr, (https://stackoverflow.com/questions/42298214/constexpr-in-c11-and-c14-not-a-difference-to-const-keyword), to remove error (with a workaround) is possible change the define constexpr in the file "serialization.h" at line 49 with a no-compiler keyword, and CryptoNight will compile in VS2017. Then set the CryptoNight correct linker reference for the libboost_serialization-vc141-mt-*.lib library of Boost C++.

serialization.h 47 #ifndef __GNUC__ 48 #ifndef constexpr 49 #define dummy 50 #endif 51 #endif

goldexone avatar Feb 04 '18 20:02 goldexone