Closed wtnan2003 closed 4 years ago
After successfully build a library libdarknet.so
when I do this:
Build darknet_server git clone https://github.com/imsoo/darknet_server cd darknet_server/server make
then cause the problem:
./src/yolo_detector.cpp: In member function ‘std::vector<std::cxx11::basic_string > YoloDetector::objects_names_from_file(std::cxx11::string)’: ./src/yolo_detector.cpp:25:30: error: variable ‘std::ifstream file’ has initializer but incomplete type std::ifstream file(filename); ^ ./src/yolo_detector.cpp: In member function ‘virtual void YoloDetector::draw(cv::Mat)’: ./src/yolo_detector.cpp:44:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] int max_width = (text_size.width > i.w + 2) ? text_size.width : (i.w + 2); ^ ./src/yolo_detector.cpp:36:13: warning: unused variable ‘colors’ [-Wunused-variable] int const colors[6][3] = { { 1,0,1 },{ 0,0,1 },{ 0,1,1 },{ 0,1,0 },{ 1,1,0 },{ 1,0,0 } }; ^ Makefile:50: recipe for target 'obj/yolo_detector.o' failed make: *** [obj/yolo_detector.o] Error 1
Any help would be helpful, thx!
@wtnan2003
Thank you for your interest in this repo.
Sorry, I forgot <fstream> header.
<fstream>
Please add this. #include <fstream>
#include <fstream>
/* yolo_detector.cpp */ #include "yolo_detector.hpp" #include <fstream> /* Here */
After successfully build a library libdarknet.so
when I do this:
then cause the problem:
./src/yolo_detector.cpp: In member function ‘std::vector<std::cxx11::basic_string > YoloDetector::objects_names_from_file(std:: cxx11::string)’:
./src/yolo_detector.cpp:25:30: error: variable ‘std::ifstream file’ has initializer but incomplete type
std::ifstream file(filename);
^
./src/yolo_detector.cpp: In member function ‘virtual void YoloDetector::draw(cv::Mat)’:
./src/yolo_detector.cpp:44:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
int max_width = (text_size.width > i.w + 2) ? text_size.width : (i.w + 2);
^
./src/yolo_detector.cpp:36:13: warning: unused variable ‘colors’ [-Wunused-variable]
int const colors[6][3] = { { 1,0,1 },{ 0,0,1 },{ 0,1,1 },{ 0,1,0 },{ 1,1,0 },{ 1,0,0 } };
^
Makefile:50: recipe for target 'obj/yolo_detector.o' failed
make: *** [obj/yolo_detector.o] Error 1
Any help would be helpful, thx!