踩坑记--/usr/include/c++/7/bits/basic_string.tcc(1067): error: expression must have pointer type

解决方式

找到:

/usr/include/c++/8/bits/basic_string.tcc:1067 :

找到:__p->_M_set_sharable()

改为:(*__p)._M_set_sharable()

cuda部分报错如下:

fused_bias_act_kernel.cuda.o 
FAILED: fused_bias_act_kernel.cuda.o 
/usr/local/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=fused -DTORCH_API_INCLUDE_EXTENSION_H -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include/TH -isystem /root/miniconda3/lib/python3.6/site-packages/torch/include/THC -isystem /usr/local/cuda/include -isystem /root/miniconda3/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_75,code=sm_75 --compiler-options '-fPIC' -std=c++14 -c xx/fused_bias_act_kernel.cu -o fused_bias_act_kernel.cuda.o 
/usr/include/c++/7/bits/basic_string.tcc(1067): error: expression must have pointer type
          detected during:
            instantiation of "std::basic_string<_CharT, _Traits, _Alloc>::_Rep *std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc &) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>]" 
(578): here
            instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_FwdIterator, _FwdIterator, const _Alloc &, std::forward_iterator_tag) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>, _FwdIterator=const char16_t *]" 
/usr/include/c++/7/bits/basic_string.h(5042): here
            instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc &, std::__false_type) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>, _InIterator=const char16_t *]" 
/usr/include/c++/7/bits/basic_string.h(5063): here
            instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc &) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>, _InIterator=const char16_t *]" 
(657): here
            instantiation of "std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT *, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc &) [with _CharT=char16_t, _Traits=std::char_traits<char16_t>, _Alloc=std::allocator<char16_t>]" 
/usr/include/c++/7/bits/basic_string.h(6688): here

/usr/include/c++/7/bits/basic_string.tcc(1067): error: expression must have pointer type
          detected during:
            instantiation of "std::basic_string<_CharT, _Traits, _Alloc>::_Rep *std::basic_string<_CharT, _Traits, _Alloc>::_Rep::_S_create(std::basic_string<_CharT, _Traits, _Alloc>::size_type, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc &) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>]" 
(578): here
            instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_FwdIterator, _FwdIterator, const _Alloc &, std::forward_iterator_tag) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>, _FwdIterator=const char32_t *]" 
/usr/include/c++/7/bits/basic_string.h(5042): here
            instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct_aux(_InIterator, _InIterator, const _Alloc &, std::__false_type) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>, _InIterator=const char32_t *]" 
/usr/include/c++/7/bits/basic_string.h(5063): here
            instantiation of "_CharT *std::basic_string<_CharT, _Traits, _Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc &) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>, _InIterator=const char32_t *]" 
(657): here
            instantiation of "std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT *, std::basic_string<_CharT, _Traits, _Alloc>::size_type, const _Alloc &) [with _CharT=char32_t, _Traits=std::char_traits<char32_t>, _Alloc=std::allocator<char32_t>]" 
/usr/include/c++/7/bits/basic_string.h(6693): here

2 errors detected in the compilation of "/tmp/tmpxft_00000e6a_00000000-6_fused_bias_act_kernel.cpp1.ii".
ninja: build stopped: subcommand failed

参考资料:

Error: Cannot call member function without object. · Issue #42 · traveller59/spconv · GitHub

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值