fight_detection icon indicating copy to clipboard operation
fight_detection copied to clipboard

fail to build client

Open jinzhao-SU opened this issue 5 years ago • 2 comments

I am very interested in this project. Could you please check the error msg? I build server part successfully, but stuck with the client.

/usr/include/x86_64-linux-gnu/sys/select.h:78:0: note: this is the location of the previous definition #define FD_SETSIZE __FD_SETSIZE ^ ./src/main.cpp:87:10: error: aggregate ‘std::ofstream out_json_file’ has incomplete type and cannot be defined ofstream out_json_file; ^ ./src/main.cpp: In function ‘int main(int, char**)’: ./src/main.cpp:142:13: error: ‘CAP_PROP_FPS’ was not declared in this scope cap.set(CAP_PROP_FPS, 20); ^ ./src/main.cpp:143:13: error: ‘CAP_PROP_BUFFERSIZE’ was not declared in this scope cap.set(CAP_PROP_BUFFERSIZE, 3); ^ ./src/main.cpp:159:24: error: ‘CAP_PROP_FPS’ was not declared in this scope double fps = cap.get(CAP_PROP_FPS); ^ ./src/main.cpp:160:23: error: ‘CAP_PROP_FRAME_COUNT’ was not declared in this scope end_frame = cap.get(CAP_PROP_FRAME_COUNT); ^ ./src/main.cpp:176:43: error: invalid use of incomplete type ‘std::ofstream {aka class std::basic_ofstream}’ out_json_file = ofstream(out_json_path); ^ In file included from /usr/include/c++/5/ios:38:0, from /usr/include/c++/5/ostream:38, from /usr/include/c++/5/iostream:39, from ./src/main.cpp:2: /usr/include/c++/5/iosfwd:119:11: note: declaration of ‘std::ofstream {aka class std::basic_ofstream}’ class basic_ofstream; ^ ./src/main.cpp:185:31: error: ‘fourcc’ is not a member of ‘cv::VideoWriter’ writer.open(out_vid_path, VideoWriter::fourcc('M', 'P', '4', 'V'), fps, Size(cap_width, cap_height), true); ^ Makefile:35: recipe for target 'obj/main.o' failed make: *** [obj/main.o] Error 1

jinzhao-SU avatar May 19 '20 08:05 jinzhao-SU

@jinzhao-SU

Thank you for your interest in this repo.


/usr/include/x86_64-linux-gnu/sys/select.h:78:0: note: this is the location of the previous definition #define FD_SETSIZE __FD_SETSIZE

  • This message can be ignored.

./src/main.cpp:87:10: error: aggregate ‘std::ofstream out_json_file’ has incomplete type and cannot be defined ofstream out_json_file;

  • Sorry, I forgot <fstream> header. I fixed it. Try this

./src/main.cpp:142:13: error: ‘CAP_PROP_FPS’ was not declared in this scope cap.set(CAP_PROP_FPS, 20);

  • It looks like OpenCV version problem. Try below changes. If it doesn't work let me know your OpenCV version.
Line From To
142 CAP_PROP_FPS CV_CAP_PROP_FPS
143 CAP_PROP_BUFFERSIZE CV_CAP_PROP_BUFFERSIZE
158 CAP_PROP_FPS CV_CAP_PROP_FPS
159 CAP_PROP_FRAME_COUNT CV_CAP_PROP_FRAME_COUNT
184 VideoWriter::fourcc('M', 'P', '4', 'V') CV_FOURCC('M', 'P', '4', 'V')

Note : This client have a freezing issue on Linux.

If you have the same issue, please let me know.

imsoo avatar May 20 '20 01:05 imsoo

I change opencv to version 3.4 and then fix all the problems. Thank you for the detailed response.

jinzhao-SU avatar May 20 '20 12:05 jinzhao-SU