Closed zzm422 closed 7 months ago
Hi, can you please give us more details on your environment (e.g. compiler, OS, OpenCV version)?
Hi Marco,
Compiler g++ == 8.4.0, OS==Linux, OpenCV == 3.2.0
I probably met the same error here:
In file included from /mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/bin/Resize.cc:21:
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/libs/magic_enum/include/magic_enum.hpp: In instantiation of ‘constexpr const auto magic_enum::detail::names_v<PillowResize::InterpolationMethods, false>’:
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/libs/magic_enum/include/magic_enum.hpp:536:27: required by substitution of ‘template<class E, bool IsFlags, class D> using names_t = decltype (names_v<D, IsFlags>) [with E = PillowResize::InterpolationMethods; bool IsFlags = false; D = std::decay~~
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/libs/magic_enum/include/magic_enum.hpp:533:23: error: ‘const auto magic_enum::detail::names_v<PillowResize::InterpolationMethods, false>’ has incomplete type
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/bin/Resize.cc: In function ‘int main(int, char**)’:
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/bin/Resize.cc:62:68: error: no matching function for call to ‘enum_names~~~~~
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/libs/magic_enum/include/magic_enum.hpp:730:30: note: substitution of deduced template arguments resulted in errors seen above
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/libs/magic_enum/include/magic_enum.hpp: In instantiation of ‘constexpr magic_enum::detail::enable_if_enum_t<E, typename std::decay<_Tp>::type> magic_enum::enum_value(std::size_t) [with E = PillowResize::InterpolationMethods; magic_enum::detail::enable_if_enum_t<E, typename std::decay<_Tp>::type> = PillowResize::InterpolationMethods; std::size_t = long unsigned int]’:
/mnt/d/wsl_workspace/mobileVLM/test_cJSON/pillow-resize/libs/magic_enum/include/magic_enum.hpp:768:27: required from ‘constexpr magic_enum::detail::enable_if_enum_t<E, std::optional<typename std::decay<_Tp>::type> > magic_enum::enum_cast(std::string_view, BinaryPredicate) [with E = PillowResize::InterpolationMethods; BinaryPredicate = magic_enum::detail::char_equal_to; magic_enum::detail::enable_if_enum_t<E, std::optional<typename std::decay<_Tp>::type> > = std::optional
bin/CMakeFiles/resize.dir/build.make:75: recipe for target 'bin/CMakeFiles/resize.dir/Resize.cc.o' failed
make[2]: *** [bin/CMakeFiles/resize.dir/Resize.cc.o] Error 1
CMakeFiles/Makefile2:959: recipe for target 'bin/CMakeFiles/resize.dir/all' failed
make[1]: *** [bin/CMakeFiles/resize.dir/all] Error 2
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2
Can you please make a test with a more recent version of gcc? If it's a problem of the compiler we can work on creating a sort of compatibility matrix to avoid this kind of problem in the future
I set to 12.1 in aarch64 and it works, the dependency is generated by magic_enum, so might need get rid of this ?
CXX=/usr/local/cortex-a76-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g++ cmake ..
Best, Lewis
Unfortunately, we can't get rid of magic_enum
since it streamlines a lot the use of enums in C++. But, we use it only in the executable, so if you are interested in using the library, and not the binaries, you can edit the makefile to exclude the bin
and tests
directories from the build.
PS: A thing we want to work on is to create a pipeline to automatically create a sort of compatibility matrix in order to avoid this kind of issue in the future.
Thanks for the reply, I definitely would like to use the binary to test the resize effects at first, it's compiled anyway. The compatibility matrix is much welcomed !
Best, Lewis
I'll close the issue. Feel free to open it again if the original problem was not caused by an old version of the compiler
pillow-resize/libs/magic_enum/include/magic_enum.hpp:533:23: error: the type 'const auto' of constexpr variable 'magic_enum::detail::names_v<PillowResize::InterpolationMethods, false>' is not literal inline constexpr auto names_v = names<E, IsFlags>(std::make_index_sequence<count_v<E, IsFlags>>{});
/pillow-resize/libs/magic_enum/include/magic_enum.hpp:533:23: error: 'const auto magic_enum::detail::names_v<PillowResize::InterpolationMethods, false>' has incomplete type /pillow-resize/bin/Resize.cc: In function 'int main(int, char**)': /pillow-resize/bin/Resize.cc:62:68: error: no matching function for call to 'enum_names()'
magic_enum::enum_names();