android studio build报错error: undefined reference to 'std::

Error:error: undefined reference to 'std::logic_error::logic_error(char const*)'
Error:error: undefined reference to 'std::logic_error::logic_error(char const*)'
Error:error: undefined reference to 'std::logic_error::logic_error(char const*)'
Error:error: undefined reference to 'std::logic_error::logic_error(char const*)'
Error:error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
Error:error: undefined reference to 'std::__ndk1::locale::locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
Error:error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
Error:error: undefined reference to 'std::__ndk1::locale::~locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
Error:error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
Error:error: undefined reference to 'std::__ndk1::locale::~locale()'
Error:error: undefined reference to 'std::__ndk1::locale::~locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
Error:error: undefined reference to 'std::__ndk1::locale::~locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
Error:error: undefined reference to 'std::__ndk1::ctype<char>::id'
Error:error: undefined reference to 'std::__ndk1::ctype<char>::id'
Error:error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
Error:error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
Error:error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
Error:error: undefined reference to 'std::__ndk1::locale::locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
Error:error: undefined reference to 'std::__ndk1::locale::locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
Error:error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
Error:error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
Error:error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
Error:error: undefined reference to 'std::__ndk1::ctype<char>::id'
Error:error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
Error:error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
Error:error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
Error:error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
Error:error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
Error:error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
Error:error: undefined reference to 'std::__ndk1::locale::locale()'
Error:error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
Error:error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
Error:error: undefined reference to 'std::__ndk1::ctype<char>::id'
Error:error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
Error:error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
Error:error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
Error:error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
Error:error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
Error:error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
Error:error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
Error:error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
Error:error: undefined reference to 'std::bad_cast::bad_cast()'
Error:error: undefined reference to 'std::bad_cast::bad_cast()'
Error:error: undefined reference to 'std::bad_cast::bad_cast()'
Error:error: undefined reference to 'std::bad_cast::bad_cast()'
Error:error: undefined reference to 'std::__ndk1::cerr'
Error:error: undefined reference to 'std::__ndk1::cout'
Error:error: undefined reference to 'std::__ndk1::cerr'
Error:error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
Error:error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
Error:error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
Error:error: undefined reference to 'std::exception_ptr::~exception_ptr()'
Error:error: undefined reference to 'std::exception_ptr::exception_ptr(std::exception_ptr const&)'
Error:error: undefined reference to 'std::rethrow_exception(std::exception_ptr)'
Error:error: undefined reference to 'std::exception_ptr::~exception_ptr()'
Error:error: undefined reference to 'std::exception_ptr::~exception_ptr()'
Error:error: undefined reference to 'std::exception_ptr::operator=(std::exception_ptr const&)'
Error:error: undefined reference to 'std::exception_ptr::~exception_ptr()'
Error:error: undefined reference to 'std::__ndk1::num_get<char, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
Error:error: undefined reference to 'std::exception_ptr::exception_ptr(std::exception_ptr const&)'
Error:error: undefined reference to 'std::rethrow_exception(std::exception_ptr)'
Error:error: undefined reference to 'std::exception_ptr::exception_ptr(std::exception_ptr const&)'
Error:error: undefined reference to 'std::rethrow_exception(std::exception_ptr)'
Error:error: undefined reference to 'std::exception_ptr::exception_ptr(std::exception_ptr const&)'
Error:error: undefined reference to 'std::rethrow_exception(std::exception_ptr)'
Error:error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
Error:error: undefined reference to 'std::bad_alloc::bad_alloc()'
Error:error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
Error:error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
Error:error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
Error:error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
Error:error: undefined reference to 'std::runtime_error::runtime_error(char const*)'
Error:error: undefined reference to 'std::bad_alloc::bad_alloc()'
Error:error: undefined reference to 'std::__ndk1::cerr'
Error:error: linker command failed with exit code 1 (use -v to see invocation)

 

https://stackoverflow.com/questions/49183886/error-undefined-reference-to-std-ndk1localelocale

参考这个网址,意思是说gnustl过时了,应该用c++_shared。于是把Application.mk中APP_STL := gnustl_static改为APP_STL := c++_shared编译通过。

[100%] Built target ego_planner_node /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o: in function `RandomMapGenerate()': /home/dxinl/Fast-Drone-250/src/uav_simulator/map_generator/src/random_forest_sensing.cpp:152: undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o: in function `RandomMapGenerateCylinder()': /home/dxinl/Fast-Drone-250/src/uav_simulator/map_generator/src/random_forest_sensing.cpp:269: undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x10): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' /usr/bin/ld: CMakeFiles/random_forest.dir/src/random_forest_sensing.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x28): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::nearestKSearch(pcl::PointXYZ const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const' collect2: error: ld returned 1 exit status make[2]: *** [uav_simulator/map_generator/CMakeFiles/random_forest.dir/build.make:329:/home/dxinl/Fast-Drone-250/devel/lib/map_generator/random_forest]
最新发布
03-13
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值