Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make errors (poss. opencv 4?) #160

Open
djkraven opened this issue Aug 27, 2018 · 4 comments
Open

Make errors (poss. opencv 4?) #160

djkraven opened this issue Aug 27, 2018 · 4 comments

Comments

@djkraven
Copy link

I am trying to make this on a Linux Mint system get the following. The Warning is easily resolved with a space. The Errors I am not as sure on the resolution.

Warning:
Building CXX object plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o
/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:86:5: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
" Help for input plugin..: "INPUT_PLUGIN_NAME"\n"
^
Errors:
Building CXX object plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o
/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp: In function ‘void* worker_thread(void*)’:
/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:408:34: error: ‘CV_IMWRITE_JPEG_QUALITY’ was not declared in this scope
compression_params.push_back(CV_IMWRITE_JPEG_QUALITY);
^~~~~~~~~~~~~~~~~~~~~~~
/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:408:34: note: suggested alternative: ‘IN_CMD_JPEG_QUALITY’
compression_params.push_back(CV_IMWRITE_JPEG_QUALITY);
^~~~~~~~~~~~~~~~~~~~~~~
IN_CMD_JPEG_QUALITY
plugins/input_opencv/CMakeFiles/input_opencv.dir/build.make:62: recipe for target 'plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o' failed
make[2]: *** [plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o] Error 1
CMakeFiles/Makefile2:237: recipe for target 'plugins/input_opencv/CMakeFiles/input_opencv.dir/all' failed
make[1]: *** [plugins/input_opencv/CMakeFiles/input_opencv.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@jacksonliam
Copy link
Owner

Is this now fixed?

@ryanmccartney
Copy link

ryanmccartney commented Oct 21, 2018

I've experienced the same error building on a Raspberry Pi running raspbian-strech. It seems to be a namespace issue. Changing;

CV_IMWRITE_JPEG_QUALITY

to

cv::IMWRITE_JPEG_QUALITY

in line 408 of file

mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp

seemed to clear up this issue and result in a successful build. See here for a pretty similar issue.

Here's my command line error from the build.

[ 31%] Building CXX object plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o /home/pi/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:86:5: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] " Help for input plugin..: "INPUT_PLUGIN_NAME"\n" \ ^ /home/pi/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp: In function ‘void* worker_thread(void*)’: /home/pi/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:408:34: error: ‘CV_IMWRITE_JPEG_QUALITY’ was not declared in this scope compression_params.push_back(CV_IMWRITE_JPEG_QUALITY); ^~~~~~~~~~~~~~~~~~~~~~~ plugins/input_opencv/CMakeFiles/input_opencv.dir/build.make:62: recipe for target 'plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o' failed make[3]: *** [plugins/input_opencv/CMakeFiles/input_opencv.dir/input_opencv.cpp.o] Error 1 make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' CMakeFiles/Makefile2:237: recipe for target 'plugins/input_opencv/CMakeFiles/input_opencv.dir/all' failed make[2]: *** [plugins/input_opencv/CMakeFiles/input_opencv.dir/all] Error 2 make[2]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' Makefile:127: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' Makefile:17: recipe for target 'all' failed make: *** [all] Error 2

@minhnhattonthat
Copy link

IMO this error related to incompatible of openCV 4, as also mentioned here.
So the options are to downgrade to openCV 3, or build with opencv plugin disabled. The later can be done with the following script

cd mjpg-streamer-experimental
cmake -DPLUGIN_INPUT_OPENCV=OFF
make
sudo make install

Of course this is just for the case that you don't need to use the openCV plugin.

@jacksonliam jacksonliam changed the title Make errors Make errors (poss. opencv 4?) Jul 3, 2020
@jacksonliam
Copy link
Owner

jacksonliam commented Jul 3, 2020

I think I have pushed a change to help with this, limiting the building of the opencv plugin to opencv 3. Could someone with the error pull the latest, do a make distclean and try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants