解决:function in namespace ‘std’ does not name a type + allocator_/nullptr/dellocator_ was not declared + base operand of ‘->’ has non-pointer type ‘std::vector’ 错误编译时报错(caffe)

时间:2022-11-19 11:19:56

解决:function in namespace ‘std’ does not name a type + allocator_/nullptr/dellocator_ was not declared + base operand of ‘->’ has non-pointer type ‘std::vector<cv::Mat>’ 错误编译时报错(caffe)

解决方法,用到了c++11,g++命令需要加上-std=c++11选项

附:g++默认的c++标准

gcc-6.4.0 gcc-7.2.0 默认是 -std=gnu++14
gcc-4.3.6 gcc-4.4.7 gcc-4.5.4 gcc-4.6.4 gcc-4.7.4 gcc-4.8.5 gcc-4.9.4 gcc-5.4.0 默认是 -std=gnu++98
gcc-3.0.4 gcc-3.1.1 gcc-3.2.3 gcc-3.3.6 gcc-3.4.6 gcc-4.0.4 gcc-4.1.2 gcc-4.2.4 默认是 -std=gnu89

其他可能错误原因:

https://www.cnblogs.com/wjgrt/p/8059074.html