title: qt編譯報錯:error: in C++98 'xxxx' must be initialized by constructor, not by '{...}'
date: 2020-07-10 08:01:26
tags: 踩坑記錄
qt編譯報錯:error: in C++98 'xxxx' must be initialized by constructor, not by '{...}'
};
^
在學習qt開發ros插件時遇到一個編譯報錯,原因是用到了C++11,而編譯是C++98,
error: in C++98 'moveBindings' must be initialized by constructor, not by '{...}'
};
^

處理方法:
在這個package下的CMakelists.txt文件加入這條代碼。
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

