error: ‘constexpr’ needed for in-class initialization of static data member ‘const double sba::Con2d

error: ‘constexpr’ needed for in-class initialization of static data member ‘const double sba::Con2dP2::qScale’ of non-integral type [-fpermissive]

编译ROS的slam_karto时出现的错误:
/opt/ros/kinetic/include/sparse_bundle_adjustment/spa2d.h:171:34: error: ‘constexpr’ needed for in-class initialization of static data member ‘const double sba::Con2dP2::qScale’ of non-integral type [-fpermissive]
const static double qScale = 1.0;

修改/opt/ros/kinetic/include/sparse_bundle_adjustment/spa2d.h:171:34中的

	const static double qScale = 1.0;

	constexpr static double qScale = 1.0; 

或者

	 static constexpr double qScale = 1.0;

解决。
c++ 11的标准问题

你可能感兴趣的:(ROS,C++)