patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

Error C2440 and C2975 in mpark_variant.hpp #263

Closed LS1995 closed 5 years ago

LS1995 commented 5 years ago

Hi! I'm new start, when I include the eos in my project, it shows that C2440 and C2975 error.

I've set the Include/Library Directories of opencv/eos and its 3rdparty, and just include the headers in my .cpp.

Most of the errors seem from the mpark_variant.hpp?

I've been troubled by this problem for quite days, could you please help me fix this problem? 捕获

patrikhuber commented 5 years ago

Hi,

What exact version of MSVC are you using?

In any case you can just set CMAKE_CXX_STANDARD 17 (which is the default), and it won't use mpark::variant anymore.

LS1995 commented 5 years ago

Hi,

What exact version of MSVC are you using?

In any case you can just set CMAKE_CXX_STANDARD 17 (which is the default), and it won't use mpark::variant anymore.

Thanks a lot ! I use Visual Studio 15 2017, after I set Properties > C/C++ > Language > C++ Language Standard to ISO C++ 17 Standard(/std:c++17), and use "#pragma warning(disable:4996)" to disable C4996 error, it builds successfully.

patrikhuber commented 5 years ago

I use Visual Studio 15 2017

It would be good to know the exact version. For example 15.9.12. And even better would be also to know the actual cl.exe version that you're using, e.g. 19.16.27031.1.

In any case if you're the only one with this issue, you probably have an old version. If it's in a relatively new version, it might be that I need to update mpark/variant, but it's hard to say without knowing further details.

I'm going to close this, people can always reopen it if it turns out to be because of a problem within eos.

Elis4Dev commented 4 years ago

Hello,

First of all, thank you for your work. 👍

I ran into the same problem as LS1995 did, after having created a C++ visual studio project and included #include "eos/morphablemodel/MorphableModel.hpp". My VS version is 15.9.12 , and when I run cl.exe (located in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64 ) I get :

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27031.1 for x64

Thank you for any insight you might have about this issue.