apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Attempting to cross-compile cyber using Clang,cyber/time/time.cc error

Open windmakeppcool opened this issue 2 years ago • 0 comments

Error report as below:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /home/test/codepath/CyberRT/cyber/time/time.cc:91:28: error: no matching constructor for initialization of 'system_clock::time_point' (aka 'time_pointstd::chrono::system_clock') system_clock::time_point tp(nano); ^ ~~~~ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1356:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::chrono::duration<long long, std::ratio<1, 1000000000>>' to 'const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1000000>>>' for 1st argument class _LIBCPP_TEMPLATE_VIS time_point ^ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1356:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::chrono::duration<long long, std::ratio<1, 1000000000>>' to 'std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1000000>>>' for 1st argument /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1370:70: note: candidate constructor not viable: no known conversion from 'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st argument _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : _d(__d) {} ^ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1375:5: note: candidate template ignored: could not match 'time_point' against 'duration' time_point(const time_point<clock, _Duration2>& t, ^ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1369:61: note: candidate constructor not viable: requires 0 arguments, but 1 was provided _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : _d(duration::zero()) {} ^ /home/test/codepath/CyberRT/cyber/time/time.cc:114:28: error: no matching constructor for initialization of 'system_clock::time_point' (aka 'time_pointstd::chrono::system_clock') system_clock::time_point tp(nano); ^ ~~~~ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1356:28: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::chrono::duration<long long, std::ratio<1, 1000000000>>' to 'const std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1000000>>>' for 1st argument class _LIBCPP_TEMPLATE_VIS time_point ^ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1356:28: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'std::chrono::duration<long long, std::ratio<1, 1000000000>>' to 'std::chrono::time_point<std::chrono::system_clock, std::chrono::duration<long long, std::ratio<1, 1000000>>>' for 1st argument /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1370:70: note: candidate constructor not viable: no known conversion from 'duration<[...], ratio<[...], 1000000000>>' to 'const duration<[...], ratio<[...], 1000000>>' for 1st argument _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : _d(__d) {} ^ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1375:5: note: candidate template ignored: could not match 'time_point' against 'duration' time_point(const time_point<clock, _Duration2>& t, ^ /home/test/SDK/aos/arm64/common/sysroot/usr/include/c++/v1/chrono:1369:61: note: candidate constructor not viable: requires 0 arguments, but 1 was provided _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : _d(duration::zero()) {} ^ >>>>>>>>>>>>>>>>>>>>>>>>>>>

it can be success by gcc but error in clang can u tell me how to handle it.thanks

windmakeppcool avatar Nov 22 '23 10:11 windmakeppcool