error C2653: 'list<class CSomething*,class std::allocator<class CSomething*> >'...解决方法

error C2653: 'list<class CSomething*,class std::allocator<class CSomething*> >' : is not a class or namespace name

原因为未引用命名空间,list的命名空间为std

加入:using namespace std;

#/home/adam/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-linux-android28 --sysroot=/home/adam/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/sysroot -o syshandle syshandle.cpp g++ -o syshandle syshandle.cpp syshandle.cpp: In function ‘auto syshandleInit()’: syshandle.cpp:330:83: error: no matching function for call to ‘myread::myread(<brace-enclosed initializer list>)’ 330 | auto mm=new myread{{{"Seccomp:$#",setZero},{"Seccomp_filters:$#",setZero}}}); | ^ syshandle.cpp:281:9: note: candidate: ‘myread::myread(const stateMM&)’ 281 | myread(const stateMM& s):syshandle(),sm(s){}; | ^~~~~~ syshandle.cpp:281:31: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const stateMM&’ 281 | myread(const stateMM& s):syshandle(),sm(s){}; | ~~~~~~~~~~~~~~~^ In file included from /usr/include/c++/13/bits/memory_resource.h:47, from /usr/include/c++/13/list:73, from syshandle.cpp:1: /usr/include/c++/13/tuple: In instantiation of ‘std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>) [with _Args1 = {const int&}; long unsigned int ..._Indexes1 = {0}; _Args2 = {}; long unsigned int ..._Indexes2 = {}; _T1 = const int; _T2 = stateMM]’: /usr/include/c++/13/tuple:2257:63: required from ‘std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>) [with _Args1 = {const int&}; _Args2 = {}; _T1 = const int; _T2 = stateMM]’ /usr/include/c++/13/bits/new_allocator.h:191:4: required from ‘void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<const int, stateMM>; _Args = {const std::piecewise_construct_t&, std::tuple<const int&>, std::tuple<>};
最新发布
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值