cuda thrust编译出错:tmpxft_testTrust.cudafe1.cpp:undefined reference to `operator delete(void*, unsigned

在编译一个需要thrust里的vector的cu文件时,报如下的错:

> nvcc testTrust.cu -o testT
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::error_category::~error_category()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system14error_categoryD0Ev[_ZN6thrust6system14error_categoryD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `_ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei[_ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei]+0x5c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei[_ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei]+0x75): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei[_ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei]+0xca): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei[_ZNK6thrust6system6detail22generic_error_category7messageB5cxx11Ei]+0xdd): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::system_error::~system_error()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system12system_errorD2Ev[_ZN6thrust6system12system_errorD5Ev]+0x24): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::system_error::~system_error()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system12system_errorD0Ev[_ZN6thrust6system12system_errorD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::system_error::system_error(int, thrust::system::error_category const&, char const*)':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system12system_errorC2EiRKNS0_14error_categoryEPKc[_ZN6thrust6system12system_errorC5EiRKNS0_14error_categoryEPKc]+0x26): undefined reference to `std::runtime_error::runtime_error(char const*)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system12system_errorC2EiRKNS0_14error_categoryEPKc[_ZN6thrust6system12system_errorC5EiRKNS0_14error_categoryEPKc]+0x5b): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::system_error::what() const':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0x19): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0x43): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0x67): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0x83): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0xb1): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0xbd): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0xcd): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system12system_error4whatEv[thrust::system::system_error::what() const]+0xe4): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `_ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei[_ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei]+0x93): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei[_ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei]+0xd1): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei[_ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei]+0xdd): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei[_ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei]+0xfa): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei[_ZNK6thrust6system8cuda_cub6detail19cuda_error_category7messageB5cxx11Ei]+0x10b): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::detail::bad_alloc::bad_alloc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6thrust6system6detail9bad_allocC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x35): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6thrust6system6detail9bad_allocC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x57): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6thrust6system6detail9bad_allocC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x6c): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6thrust6system6detail9bad_allocC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x83): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6thrust6system6detail9bad_allocC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x98): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::detail::bad_alloc::~bad_alloc()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocD2Ev[_ZN6thrust6system6detail9bad_allocD5Ev]+0x24): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::detail::bad_alloc::~bad_alloc()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail9bad_allocD0Ev[_ZN6thrust6system6detail9bad_allocD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::detail::bad_alloc::what() const':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZNK6thrust6system6detail9bad_alloc4whatEv[thrust::system::detail::bad_alloc::what() const]+0x18): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::detail::allocator_mismatch_on_swap::allocator_mismatch_on_swap()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6detail26allocator_mismatch_on_swapC2Ev[_ZN6thrust6detail26allocator_mismatch_on_swapC5Ev]+0x19): undefined reference to `std::runtime_error::runtime_error(char const*)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*)':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_[std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*)]+0x23): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_[std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, char const*)]+0x3d): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::detail::allocator_mismatch_on_swap::~allocator_mismatch_on_swap()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6detail26allocator_mismatch_on_swapD0Ev[_ZN6thrust6detail26allocator_mismatch_on_swapD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::mr::memory_resource<thrust::device_ptr<void> >::~memory_resource()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust2mr15memory_resourceINS_10device_ptrIvEEED0Ev[_ZN6thrust2mr15memory_resourceINS_10device_ptrIvEEED5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::device_ptr_memory_resource<thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> > >::~device_ptr_memory_resource()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust26device_ptr_memory_resourceINS_6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEEEED0Ev[_ZN6thrust26device_ptr_memory_resourceINS_6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEEEED5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `void thrust::detail::vector_base<int, thrust::device_allocator<int> >::allocate_and_copy<thrust::detail::normal_iterator<int const*> >(unsigned long, thrust::detail::normal_iterator<int const*>, thrust::detail::normal_iterator<int const*>, thrust::detail::contiguous_storage<int, thrust::device_allocator<int> >&)':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6detail11vector_baseIiNS_16device_allocatorIiEEE17allocate_and_copyINS0_15normal_iteratorIPKiEEEEvmT_SA_RNS0_18contiguous_storageIiS3_EE[void thrust::detail::vector_base<int, thrust::device_allocator<int> >::allocate_and_copy<thrust::detail::normal_iterator<int const*> >(unsigned long, thrust::detail::normal_iterator<int const*>, thrust::detail::normal_iterator<int const*>, thrust::detail::contiguous_storage<int, thrust::device_allocator<int> >&)]+0xad): undefined reference to `std::length_error::length_error(char const*)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::mr::memory_resource<thrust::cuda_cub::pointer<void> >::~memory_resource()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust2mr15memory_resourceINS_8cuda_cub7pointerIvEEED0Ev[_ZN6thrust2mr15memory_resourceINS_8cuda_cub7pointerIvEEED5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::~cuda_memory_resource()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEED0Ev[_ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEED5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEE11do_allocateEmm[thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)]+0x82): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEE11do_allocateEmm[thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)]+0x98): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEE11do_allocateEmm[thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)]+0xb3): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEE11do_allocateEmm[thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)]+0xbf): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEE11do_allocateEmm[thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)]+0x105): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system4cuda6detail20cuda_memory_resourceIXadL_Z10cudaMallocEEXadL_Z8cudaFreeEENS_8cuda_cub7pointerIvEEE11do_allocateEmm[thrust::system::cuda::detail::cuda_memory_resource<&cudaMalloc, &cudaFree, thrust::cuda_cub::pointer<void> >::do_allocate(unsigned long, unsigned long)]+0x116): undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::cuda_cub::detail::cuda_error_category::~cuda_error_category()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system8cuda_cub6detail19cuda_error_categoryD0Ev[_ZN6thrust6system8cuda_cub6detail19cuda_error_categoryD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::detail::system_error_category::~system_error_category()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail21system_error_categoryD0Ev[_ZN6thrust6system6detail21system_error_categoryD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
/tmp/tmpxft_00005f37_00000000-10_testTrust.o: In function `thrust::system::detail::generic_error_category::~generic_error_category()':
tmpxft_00005f37_00000000-5_testTrust.cudafe1.cpp:(.text._ZN6thrust6system6detail22generic_error_categoryD0Ev[_ZN6thrust6system6detail22generic_error_categoryD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
collect2: ld returned 1 exit status

一开始以为是thrust版本不一致,也看到网上类似的问题,但是他们是缺少连接cudart,报的是cudafree类似函数的错,后来我仔细看这错误,发现是c++里面的函数没有定义的问题,所以联想到了gcc和g++

发现两者不匹配

于是去修改g++链接的版本

which g++

ln s gcc新版本下/g++ 要链接到的地方

问题解决,成功运行

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值