MhLiao / TextBoxes_plusplus

TextBoxes++: A Single-Shot Oriented Scene Text Detector
Other
953 stars 279 forks source link

[SOLVED] - Compilation error: src/caffe/util/bbox_util.cpp:723:23: error: ‘format’ is not a member of ‘boost’ #5

Closed namp closed 6 years ago

namp commented 6 years ago

make

CXX src/caffe/util/bbox_util.cpp src/caffe/util/bbox_util.cpp: In function ‘void caffe::RboxToPolygon(caffe::NormalizedRBox, caffe::Polygon&)’: src/caffe/util/bbox_util.cpp:723:23: error: ‘format’ is not a member of ‘boost’ std::string s = str(boost::format("POLYGON((%1% %2%, %3% %4%, %5% %6%, %7% %8%, %9% %10%))") % x1 % y1 % x2 % y2 % x3 % y3 % x4 % y4 % x1 % y1); ^ src/caffe/util/bbox_util.cpp:723:23: note: suggested alternative: In file included from /usr/include/opencv2/core.hpp:3214:0, from /usr/include/opencv2/core/core.hpp:48, from ./include/caffe/util/bbox_util.hpp:2, from src/caffe/util/bbox_util.cpp:22: /usr/include/opencv2/core/operations.hpp:371:16: note: ‘cv::format’ Ptr format(InputArray mtx, int fmt) ^ src/caffe/util/bbox_util.cpp:723:145: error: ‘str’ was not declared in this scope std::string s = str(boost::format("POLYGON((%1% %2%, %3% %4%, %5% %6%, %7% %8%, %9% %10%))") % x1 % y1 % x2 % y2 % x3 % y3 % x4 % y4 % x1 % y1); ^ src/caffe/util/bbox_util.cpp: In function ‘void caffe::RboxToPolygon(const Dtype, caffe::Polygon&)’: src/caffe/util/bbox_util.cpp:743:23: error: ‘format’ is not a member of ‘boost’ std::string s = str(boost::format("POLYGON((%1% %2%, %3% %4%, %5% %6%, %7% %8%, %9% %10%))") % x1 % y1 % x2 % y2 % x3 % y3 % x4 % y4 % x1 % y1); ^ src/caffe/util/bbox_util.cpp:743:23: note: suggested alternative: In file included from /usr/include/opencv2/core.hpp:3214:0, from /usr/include/opencv2/core/core.hpp:48, from ./include/caffe/util/bbox_util.hpp:2, from src/caffe/util/bbox_util.cpp:22: /usr/include/opencv2/core/operations.hpp:371:16: note: ‘cv::format’ Ptr format(InputArray mtx, int fmt) ^ src/caffe/util/bbox_util.cpp:743:145: error: there are no arguments to ‘str’ that depend on a template parameter, so a declaration of ‘str’ must be available [-fpermissive] std::string s = str(boost::format("POLYGON((%1% %2%, %3% %4%, %5% %6%, %7% %8%, %9% %10%))") % x1 % y1 % x2 % y2 % x3 % y3 % x4 % y4 % x1 % y1); ^ src/caffe/util/bbox_util.cpp:743:145: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) src/caffe/util/bbox_util.cpp: In instantiation of ‘void caffe::RboxToPolygon(const Dtype, caffe::Polygon&) [with Dtype = float; caffe::Polygon = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy >]’: src/caffe/util/bbox_util.cpp:747:64: required from here src/caffe/util/bbox_util.cpp:743:22: error: ‘str’ was not declared in this scope std::string s = str(boost::format("POLYGON((%1% %2%, %3% %4%, %5% %6%, %7% %8%, %9% %10%))") % x1 % y1 % x2 % y2 % x3 % y3 % x4 % y4 % x1 % y1); ^ src/caffe/util/bbox_util.cpp: In instantiation of ‘void caffe::RboxToPolygon(const Dtype*, caffe::Polygon&) [with Dtype = double; caffe::Polygon = boost::geometry::model::polygon<boost::geometry::model::d2::point_xy >]’: src/caffe/util/bbox_util.cpp:748:65: required from here src/caffe/util/bbox_util.cpp:743:22: error: ‘str’ was not declared in this scope Makefile:575: recipe for target '.build_release/src/caffe/util/bbox_util.o' failed make: *** [.build_release/src/caffe/util/bbox_util.o] Error 1

namp commented 6 years ago

It was solved by adding the following line at "src/caffe/util/bbox_util.cpp"

include <boost/format.hpp>