Closed lilongyang8 closed 1 month ago
[[nodiscard]] static constexpr auto enum_value_count(std::integer_sequence<int, I...>) noexcept { constexpr int n = sizeof...(I); constexpr std::array<bool, n> valid{}; constexpr int num_valid = ((valid[I] ? 1 : 0) + ...); return num_valid; }
修改代码就可以完成编译
环境: gcc: stable 14.2.0 Apple clang version 15.0.0 (clang-1500.3.9.4) Target: x86_64-apple-darwin23.6.0 Thread model: posix cmake: stable 3.30.3 xcode:15.4
xrprimer 构建成功 xrslam 构建报错
`clang: warning: overriding '-miphoneos-version-min=12.0' option with '-target arm64-apple-ios17.5' [-Woverriding-t-option] In file included from /Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/map/track.cpp:1: In file included from /Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/estimation/solver.h:5: In file included from /Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/estimation/marginalization_factor.h:5: In file included from /Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/map/frame.h:8: /Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error: integer value 4 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] {!enum_value_name<static_cast(I)>().empty()...}};
^
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 5 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 6 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 7 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 8 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 9 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 10 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 11 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 12 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 13 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 14 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 15 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 16 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 17 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 18 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 19 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 20 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 21 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
/Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/utility/tag.h:42:31: error:
integer value 22 is outside the valid range of values [0, 3] for this
enumeration type [-Wenum-constexpr-conversion]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
....
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'xrslam-superbuild') note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'xrslam-superbuild') note: Run script build phase 'CMake PostBuild Rules' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'xrslam' from project 'xrslam-superbuild') BUILD FAILEDThe following build commands failed: CompileC /Users/lilongyang/CLionProjects/xrslam/build/iOS/build/xrslam-core.build/Release-iphoneos/Objects-normal/arm64/track.o /Users/lilongyang/CLionProjects/xrslam/xrslam/src/xrslam/map/track.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'xrslam-core' from project 'xrslam-superbuild') (1 failure) ` 麻烦看一下什么情况吗