Electron常见问题 8-error: non-const static data member must be initialized out of li
目录问题
解决
PS:《Electron实战》系列-总览
问题 编译electron报错:
In file included from ../../electron/shell/browser/api/atom_api_web_contents.h:33:
../../third_party/webrtc/pc/rtp_sender.h:187:32: error: non-const static data member must be initialized out of line解决 解决方法:
将非const类型的静态变量拿到类外去初始化。
例子:
// 错误定义方式
class Test {
int a;
const int b = 1;
static int c = 2;//wrong
}
// 正确定义方式
static int c = 2;
class Test {
int a;
const int b = 1;
}
文档来源:51CTO技术博客https://blog.51cto.com/u_14832233/2985609
页:
[1]