From 2e62298e66cca8f5432b7086feac031e4a600e6b Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 22 Oct 2015 11:11:37 +0200 Subject: [PATCH] Fix a compilation error when using clang++ Clang gives this error: In file included from opencv_trail_effect.cpp:25: ./Trail.hpp:13:22: error: in-class initialization of non-static data member is a C++11 extension [-Werror,-Wc++11-extensions] cv::Mat *background = NULL; ^ 1 error generated. : recipe for target 'opencv_trail_effect.o' failed make: *** [opencv_trail_effect.o] Error 1 Fix it to make compilation succeed. --- Trail.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Trail.hpp b/Trail.hpp index e519c94..ecf486a 100644 --- a/Trail.hpp +++ b/Trail.hpp @@ -10,7 +10,7 @@ class Trail { private: virtual void iterate(cv::Mat& frame, void (*action)(cv::Mat&, Frame *, int, int)) = 0; - cv::Mat *background = NULL; + cv::Mat *background; bool redraw_current_frame; bool persistent; @@ -58,6 +58,7 @@ protected: public: Trail(int trail_length, cv::Size frame_size) { + background = NULL; redraw_current_frame = false; drawStrategy = frameCopy; persistent = false; -- 2.1.4