文章目录 VScode C++ 编译error 一、报错信息: 二、文件结构: 三、问题分析 四、问题解决 方法一:去掉多余的含入 方法二:使用前置声明 VScode C++ 编译error 一、报错信息: ‘XXX’ was not declared in this scope template argument 1 is invalid 二、文件结构: //A.h #ifndef __A__ #define __A__ #include"B.h" #include<vector> class A{ public: std::vector<B> myB; ... } #endif //B.h