C++函数没有返回值报错

报错信息如下

Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
E0413 13:18:42.318601 56309 log_utils.h:13] *** Aborted at 1681363122 (unix time) try “date -d @1681363122” if you are using GNU date ***
E0413 13:18:42.319919 56309 log_utils.h:13] PC: @ 0x7fe77e27700b gsignal
E0413 13:18:42.320152 56309 log_utils.h:13] *** SIGABRT (@0x3e80000dbf5) received by PID 56309 (TID 0x7fe779f9d840) from PID 56309; stack trace: ***
E0413 13:18:42.321146 56309 log_utils.h:13] @ 0x7fe77e7b9631 (unknown)
E0413 13:18:42.322158 56309 log_utils.h:13] @ 0x7fe77e827420 (unknown)
E0413 13:18:42.323024 56309 log_utils.h:13] @ 0x7fe77e27700b gsignal
E0413 13:18:42.323879 56309 log_utils.h:13] @ 0x7fe77e256859 abort
E0413 13:18:42.324956 56309 log_utils.h:13] @ 0x7fe77e630911 (unknown)
E0413 13:18:42.326010 56309 log_utils.h:13] @ 0x7fe77e63c38c (unknown)
E0413 13:18:42.326905 56309 log_utils.h:13] @ 0x7fe77e63c3f7 std::terminate()
E0413 13:18:42.327858 56309 log_utils.h:13] @ 0x7fe77e63c6a9 __cxa_throw
E0413 13:18:42.328912 56309 log_utils.h:13] @ 0x7fe77e630522 (unknown)
E0413 13:18:42.329803 56309 log_utils.h:13] @ 0x7fe77e6d529f std::__cxx11::basic_string<>::_M_assign()
E0413 13:18:42.329883 56309 log_utils.h:13] @ 0x5570ed3b851f pcl::fromROSMsg<>()
E0413 13:18:42.329946 56309 log_utils.h:13] @ 0x5570ed3b9033 SubMapBuilder::BuildSubMap()
E0413 13:18:42.330001 56309 log_utils.h:13] @ 0x5570ed39d2e3 main
E0413 13:18:42.330902 56309 log_utils.h:13] @ 0x7fe77e258083 __libc_start_main
E0413 13:18:42.330963 56309 log_utils.h:13] @ 0x5570ed39e1be _start

原因:
c++17里面,函数没有给正确的返回值。

另外pcl编程时,注意智能指针没实例化也容易报错。

你可能感兴趣的:(c++,c++,开发语言)