使用vector <data type =“”>进行arm编译时出错

时间:2016-06-20 08:52:17

标签: c++ vector stl

我正在使用vector&lt;双&gt;带有能量的TI CC3200的c ++程序的数​​据类型,但它会引发一个很大的错误

  

waveletone \ waveletnew.cpp.o:在函数std::_Vector_base<double, std::allocator<double> >::_M_allocate(unsigned int) [clone .isra.41]': waveletnew.cpp:(.text._ZNSt12_Vector_baseIdSaIdEE11_M_allocateEj.isra.41+0xa): undefined reference to std :: __ throw_bad_alloc()&#39;   waveletone \ waveletnew.cpp.o:在函数std::vector<double, std::allocator<double> >::_M_check_len(unsigned int, char const*) const': waveletnew.cpp:(.text._ZNKSt6vectorIdSaIdEE12_M_check_lenEjPKc[_ZNKSt6vectorIdSaIdEE12_M_check_lenEjPKc]+0x18): undefined reference to std :: __ throw_length_error(char const *)&#39;   waveletone \ waveletnew.cpp.o:在函数std::vector<std::complex<double>, std::allocator<std::complex<double> > >::_M_check_len(unsigned int, char const*) const': waveletnew.cpp:(.text._ZNKSt6vectorISt7complexIdESaIS1_EE12_M_check_lenEjPKc[_ZNKSt6vectorISt7complexIdESaIS1_EE12_M_check_lenEjPKc]+0x18): undefined reference to std :: __ throw_length_error(char const *)&#39;   waveletone \ waveletnew.cpp.o:在函数std::vector<std::complex<double>, std::allocator<std::complex<double> > >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::complex<double>*, std::vector<std::complex<double>, std::allocator<std::complex<double> > > >, std::complex<double> const&)': waveletnew.cpp:(.text._ZNSt6vectorISt7complexIdESaIS1_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS1_S3_EERKS1_[_ZNSt6vectorISt7complexIdESaIS1_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS1_S3_EERKS1_]+0x68): undefined reference to std :: __ throw_bad_alloc()&#39;   waveletone \ waveletnew.cpp.o:在函数std::vector<std::complex<double>, std::allocator<std::complex<double> > >::_M_fill_insert(__gnu_cxx::__normal_iterator<std::complex<double>*, std::vector<std::complex<double>, std::allocator<std::complex<double> > > >, unsigned int, std::complex<double> const&)': waveletnew.cpp:(.text._ZNSt6vectorISt7complexIdESaIS1_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS1_S3_EEjRKS1_[_ZNSt6vectorISt7complexIdESaIS1_EE14_M_fill_insertEN9__gnu_cxx17__normal_iteratorIPS1_S3_EEjRKS1_]+0xb0): undefined reference to std :: __ throw_bad_alloc()&#39;   waveletone \ waveletnew.cpp.o:在函数iswt(std::vector<double, std::allocator<double> >&, int, std::vector<double, std::allocator<double> >&)': waveletnew.cpp:(.text._Z4iswtRSt6vectorIdSaIdEEiS2_+0x42c): undefined reference to std :: __ throw_out_of_range(char const *)&#39;   collect2.exe:错误:ld返回1退出状态

waveletnew.cpp是小波标题源文件。

1 个答案:

答案 0 :(得分:0)

这似乎是链接器错误。

当您在C ++ STL中使用函数但没有链接C ++库时,您可以尝试修改Application.mk文件,然后添加APP_STL := gnustl_shared。我希望这对你有帮助。