編譯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;
}