1,error: template declaration of 'typedef'

typedef std::function<void(Input begin>  My_Func

 

解决方案:

template <typename Input>
using std::function<void(Input begin>;

参考链接 :
https://stackoverflow.com/questions/19192122/template-declaration-of-typedef-typename-footbar-bar


2,error: field 'group_' has incomplete type
原因:使用了类的前置声明,但又进行了对你实例化,此时系统不知道为该对象分配多大空间;正确使用方式为:在使用前置声明时不要在头文件中直接定义对象,而是定义一个指针,在.cc文件中去new;

 

 2,error: const 二级指针:invalid conversion from 'char**' to 'const char**'

参考链接: https://blog.csdn.net/duyiwuer2009/article/details/39401801

3,Error: expected type-specifier before 'T'

原因:1)未引入类型T的头文件,引入相关头文件即可 ;

           2)可能该头文件中的#define  __*_H_在其他头文件中重复定义,查找重复使用#define 预编译项;

 

4,error: 'static' may not be used when defining (as opposed to declaring) a static data member [-fpermissive]

原因:在定义静态变量时,前面加了static关键字,去除这个sttic关键字即可,只需要在声明时加上static; 

 

相关文章:

  • 2021-11-03
  • 2021-12-07
  • 2021-06-28
  • 2021-09-07
  • 2021-08-10
  • 2021-06-19
  • 2021-05-03
  • 2021-10-25
猜你喜欢
  • 2021-10-08
  • 2021-09-09
  • 2021-09-29
  • 2021-12-28
  • 2021-08-23
  • 2022-01-05
  • 2021-12-21
  • 2021-10-04
相关资源
相似解决方案