patrikhuber / eos

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

Compile errors with either toml or mpark-variant #310

Closed towermalta closed 4 years ago

towermalta commented 4 years ago

I refer to the eos model and want to run fit-moel.cpp in example. The settings I used are (windows10+visual studio 2017 15.9+opencv 3.2.0+boost 1.73.0), but I encountered the following error at runtime. ps. I also tried (visual studio 2019+opencv 3.2.0+boost 1.72.0), still got same problem: image The expression it said is: image I wonder if anyone got same problem when building this project and know the solution for it.

patrikhuber commented 4 years ago

Hi,

Perhaps you can try updating the toml submodule? For mpark::variant, I directly copied the file from the mpark repository to here, you can try updating the file with the latest version.

Also, if you compile eos in C++17 mode, you should not receive the mpark::variant errors, as the code should use std::variant instead!

Let us know how you get along.

patrikhuber commented 4 years ago

I should also mention that I am successfully using eos on VS 2019 16.6.0 and am not getting any toml errors. So it may only be a problem with mpark::variant (which an update might fix, as suggested). I am also not getting any errors with CMAKE_CXX_STANDARD 17, because, as mentioned, this will use std::variant.

towermalta commented 4 years ago

Hello, glad to have your reply, here is my update. I changed my previous method and used vcpkg on visual studio 2019 to install the dependencies. then I get the build directory as follows: image I use visual studio to open eos.sln in this folder, compile it in C++17 mode and build INSTALL successfully. The following screenshot shows what it looks like in vs2019: image And I try to run the fit-model, but it gives error like: image I wonder how to fix this problem, is it because I don't run INSTALL? but every tim"e I want to run INSTALL, it will say "access denied" like this: image And another thing, I don't find this install folder: image Looking forward to have your reply!

patrikhuber commented 4 years ago

Okay, it sounds like this indeed was a problem with your local build.

I don't run INSTALL? but every tim"e I want to run INSTALL, it will say "access denied" like this:

Probably you're trying to install to the default CMake INSTALL directory, which is along the lines of C:\Program Files..., so you'll need admin rights. You can change that, see cmake-gui or the cmake documentation.

I don't find this install folder:

After you've run the INSTALL target, these files will be in your CMake INSTALL directory. Again, see the CMake documentation. The files are copied from share/ and examples/data/.

These are generic CMake and Visual Studio setup questions, if you need further help, then a place like StackOverflow is a more appropriate place to get help for such things.