Is magic_enum supported on WindRiver VxWorks 7 SR 0640 LLVM/Clang 9.0.1
I have a multi-platform project that uses magic_enum.
Have successfully compiled and ran in the following configurations:
- Windows 10 VS2019 CL compiler
- Windows 10 VS2019 LLVM/Clang 9.0.1 compiler
- Redhat 8 GNU 10 compiler
Attempting to compile example.cpp using WR Workbench 4.0, VxWorks 7 SR 0640, LLVM/Clang 9.0.1 and am experiencing several compilation issues similar to the following (full compile output can be provided if needed):
[ 50%] Building CXX object magic_enum-master/example/CMakeFiles/example.dir/C_/TEMP/enum_test/EnumTest/magic_enum-master/example/example.o
cd /c/TEMP/enum_test/EnumTest/vsb_SIMNTllvm_LP64/build/magic_enum-master/example && /C/Apps/WindRiver/WorkBench4.0/compilers/llvm-9.0.1.1/WIN64/bin/clang -I/C/TEMP/enum_test/EnumTest/magic_enum-master/include/magic_enum -gdwarf-3 --target=x86_64 -m64 -mcmodel=large -fno-omit-frame-pointer -mno-red-zone -ansi -fno-strict-aliasing -fno-builtin -D__vxworks -D__VXWORKS__ -D__RTP__ -D__ELF__ -nostdlibinc -nostdinc++ -D_USE_INIT_ARRAY -ftls-model=local-exec -std=c++17 -MD -MP -D_VX_CPU=VX_SIMNT -D_VX_TOOL_FAMILY=llvm -D_VX_TOOL=llvm -D_VSB_CONFIG_FILE="C:/TEMP/enum_test/EnumTest/../vxsim/vsb/h/config/vsbConfig.h" -IC:/TEMP/enum_test/EnumTest/../vxsim/vsb/share/h -isystem C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public -isystem C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h -Wall -Wextra -pedantic-errors -Werror -std=c++17 -o CMakeFiles/example.dir/C/TEMP/enum_test/EnumTest/magic_enum-master/example/example.o -c C:/TEMP/enum_test/EnumTest/magic_enum-master/example/example.cpp
In file included from C:/TEMP/enum_test/EnumTest/magic_enum-master/example/example.cpp:23:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\iostream:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\istream:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\ostream:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\ios:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xlocnum:8:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\streambuf:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xiosbase:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xlocale:6:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\stdexcept:5:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstring:6:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstring_view:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xmemory0:8:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xutility:6:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\utility:7:
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\type_traits:2988:24: error: no matching constructor for initialization of 'std::equal_to
Is there any information that can be shared to help me move forward.
Am I trying to do something that is not supported?
Has anyone tried Magic Enum on VxWorks 7 SR0640?
Hi, I can’t understand what the problem is, and unfortunately I’m not familiar with VxWorks. I found only this issues https://github.com/Neargye/magic_enum/issues/46
Hi, I can’t understand what the problem is, and unfortunately I’m not familiar with VxWorks. I found only this issues #46
Thank you for taking the time to look. If I ever figure it out, I will let you know.
FYI
I moved to VxWorks 7 24.03 and magic-enum compiled with one issue in magic_enum::enum_index()
If you are interested the compilation errors are: C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1241:18: error: constexpr variable 'index' must be initialized by a constant expression 1241 | constexpr auto index = enum_index<std::decay_t<decltype(V)>, S>(V); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/TEMP/test/ngj_lb/projects/ifs/source/Enum.h:359:26: note: in instantiation of function template specialization 'magic_enum::enum_index<EnumTest::TestEnum::NINTH, magic_enum::detail::enum_subtype::common>' requested here 359 | return magic_enum::enum_index<Value>(); | ^ C:/TEMP/test/ngj_lb/projects/ifs/test/EnumTest.cpp:134:28: note: in instantiation of function template specialization 'ifs::Enum::indexEnumTest::TestEnum::NINTH' requested here 134 | EXPECT_EQ(9, ifs::Enum::indexEnumTest::TestEnum::NINTH()); | ^ C:/TEMP/test/vxworks_bsp/vxsim/vsb/usr/h/public/optional:144:3: note: dynamic memory allocation is not permitted in constant expressions until C++20 144 | ::new ((void *)&this->_Myvalue) _Ty(_STD forward<_U>(_Value)); | ^ C:/TEMP/test/vxworks_bsp/vxsim/vsb/usr/h/public/optional:263:6: note: in call to '_Optional_base(static_caststd::size_t(v - detail::min_v<D, (magic_enum::detail::enum_subtype)0>))' 263 | : _Mybase(_STD forward<_Uty>(_Right)) | ^ C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1223:14: note: in call to 'optional(static_caststd::size_t(v - detail::min_v<D, (magic_enum::detail::enum_subtype)0>))' 1223 | return static_caststd::size_t(v - detail::min_v<D, S>); | ^ C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1241:26: note: in call to 'enum_index(9)' 1241 | constexpr auto index = enum_index<std::decay_t<decltype(V)>, S>(V); | ^ C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1242:17: error: static assertion expression is not an integral constant expression 1242 | static_assert(index, "magic_enum::enum_index enum value does not have a index."); | ^~~~~ C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1242:17: note: initializer of 'index' is not a constant expression C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1241:18: note: declared here 1241 | constexpr auto index = enum_index<std::decay_t<decltype(V)>, S>(V); | ^ 2 errors generated.