patrikhuber / eos

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

Build error with toml11 from Homebrew: no member named 'Table' 'Integer' 'String' #343

Closed ilciavo closed 1 year ago

ilciavo commented 2 years ago

When I try to build I get the following errors:

In file included from /Users/leo/Desktop/Coding/C++/eos/examples/fit-model-simple.cpp:23:
/Users/leo/Desktop/Coding/C++/eos/include/eos/core/LandmarkMapper.hpp:77:53: error: no member named 'Table' in namespace 'toml'
        const auto mappings_table = toml::get<toml::Table>(data.at("landmark_mappings"));
                                              ~~~~~~^
/Users/leo/Desktop/Coding/C++/eos/include/eos/core/LandmarkMapper.hpp:86:33: error: no member named 'Integer' in 'toml::value_t'
            case toml::value_t::Integer:
                 ~~~~~~~~~~~~~~~^
/Users/leo/Desktop/Coding/C++/eos/include/eos/core/LandmarkMapper.hpp:89:33: error: no member named 'String' in 'toml::value_t'
            case toml::value_t::String:
                 ~~~~~~~~~~~~~~~^
3 errors generated.
make[2]: *** [examples/CMakeFiles/fit-model-simple.dir/fit-model-simple.cpp.o] Error 1
make[1]: *** [examples/CMakeFiles/fit-model-simple.dir/all] Error 2
In file included from /Users/leo/Desktop/Coding/C++/eos/include/eos/fitting/fitting.hpp:34:
/Users/leo/Desktop/Coding/C++/eos/include/eos/fitting/contour_correspondence.hpp:167:52: error: no member named 'Table' in namespace 'toml'
        const auto contour_table = toml::get<toml::Table>(data.at("contour_landmarks"));
                                             ~~~~~~^
/Users/leo/Desktop/Coding/C++/eos/include/eos/fitting/contour_correspondence.hpp:179:33: error: no member named 'Integer' in 'toml::value_t'
            case toml::value_t::Integer:
                 ~~~~~~~~~~~~~~~^
/Users/leo/Desktop/Coding/C++/eos/include/eos/fitting/contour_correspondence.hpp:182:33: error: no member named 'String' in 'toml::value_t'
            case toml::value_t::String:
                 ~~~~~~~~~~~~~~~^
/Users/leo/Desktop/Coding/C++/eos/include/eos/fitting/contour_correspondence.hpp:197:33: error: no member named 'Integer' in 'toml::value_t'
            case toml::value_t::Integer:
                 ~~~~~~~~~~~~~~~^
/Users/leo/Desktop/Coding/C++/eos/include/eos/fitting/contour_correspondence.hpp:200:33: error: no member named 'String' in 'toml::value_t'
            case toml::value_t::String:
                 ~~~~~~~~~~~~~~~^
5 errors generated.
make[2]: *** [examples/CMakeFiles/fit-model-multi.dir/fit-model-multi.cpp.o] Error 1
make[1]: *** [examples/CMakeFiles/fit-model-multi.dir/all] Error 2
make: *** [all] Error 2

Changing to toml::table, toml::value_t::integer, and toml::value_t::string seems to solve the errors. I'm using toml11 3.7.1 from Homebrew
Cheers

patrikhuber commented 2 years ago

It looks like toml11 received some updates recently! I should update the toml submodule in eos. Thank you very much for reporting this.

patrikhuber commented 1 year ago

I've updated the toml11 submodule and also updated eos, so it works with the most recent toml11 versions, see 1a2c393ee0c26d26be251a7e0452e48b442ff72d.

I'll leave this open until I merge it into master, but for anyone encountering this issue, just switch to the devel branch.

Thank you again for reporting this together with what you had to change!

patrikhuber commented 1 year ago

The fix/update is now released officially in v1.4.0.

ilciavo commented 1 year ago

Super !! I'll check and report if I find anything

patrikhuber commented 1 year ago

@ilciavo Thanks! Chances are the latest update might have broken other things on macOS 😆 - but hopefully not. The code should be very standard-compliant and probably the compiler situation on macOS has improved as well. I've also tested the latest release on both a recent g++ and clang and it worked fine.