I have been working on a project and first I built it with visual studio solutions and it worked perfectly. However, when trying to build the same project with CMake an error occurs that I cannot understand why it happens!
Here is the error message
C2440 'reinterpret_cast': cannot convert from 'F' to 'andrivet::ADVobfuscator::ObfuscatedAddress<std::string>::func_ptr_integral'
my_project_directory\out\build\x64-Debug\quantumsample
C:\Users\Bpc\myProjects\vcpkg-master\installed\x64-windows-mixed\include\Lib\MetaFSM.h 162
And here is the block code of this part
template<typename F>
struct ObfuscatedAddress
{
// Pointer to a function
using func_ptr_t = void(*)();
// Integral type big enough (and not too big) to store a function pointer
using func_ptr_integral = std::conditional<sizeof(func_ptr_t) <= sizeof(long), long, long long>::type;
func_ptr_integral f_;
int offset_;
constexpr ObfuscatedAddress(F f, int offset): f_{reinterpret_cast<func_ptr_integral>(f) + offset}, offset_{offset} {}
constexpr F original() const { return reinterpret_cast<F>(f_ - offset_); }
};
I have been working on a project and first I built it with visual studio solutions and it worked perfectly. However, when trying to build the same project with CMake an error occurs that I cannot understand why it happens!
Here is the error message
And here is the block code of this part