Compiling OpenCV errors - python-2.7

I trying to install opencv on my raspberry pi 3b+. Iam basing on tutorial from pyimagesearch.Iam on Step #5: Compile and Install OpenCV. I got errors after I execute make command. On 15% I got errors like on the screen.
Errors:
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/fully_connected_layer.cpp.o
/home/pi/opencv-3.1.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool OutputMediaStream_FFMPEG::open(const char*, int, int, double)’:
/home/pi/opencv-3.1.0/modules/videoio/src/cap_ffmpeg_impl.hpp:2207:30: warning: ignoring return value of ‘int avformat_write_header(AVFormatContext*, AVDictionary**)’, declared with attribute warn_unused_result [-Wunused-result]
avformat_write_header(oc_, NULL);
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:154: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4209: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/im2col.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/layers_common.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/lrn_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/mvn_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/pooling_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/reshape_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/slice_layer.cpp.o
[ 22%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/softmax_layer.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/split_layer.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THDiskFile.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THFile.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/THGeneral.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/torch/torch_importer.cpp.o
[ 23%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/opencl_kernels_dnn.cpp.o
[ 23%] Linking CXX shared library ../../lib/libopencv_dnn.so
[ 23%] Built target opencv_dnn
make: *** [Makefile:163: all] Error 2
When my cmake looks like:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D WITH_TBB=OFF \
-D BUILD_EXAMPLES=ON ..
I got errors like:
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:154: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:4209: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
I will be greateful for any advice.

Okey, I handled the problem. My solution was to install brand new Raspberry Pi Buster image on sd card. Then I installed opencv basing on another tutorial from pyimagesearch.

Related

opencv c++ fails the make -j4

I'm trying to install OpenCV in c++ locally on my machine with Ubuntu 20.04.5 LST following this manual.
The first two steps went good, but I'm stuck on the make -j4 substep of the third step. Running this command results in the following error message:
[ 83%] Linking CXX executable ../../bin/opencv_test_highgui
[ 83%] Built target opencv_test_calib3d
[ 83%] Built target opencv_perf_objdetect
[ 83%] Built target opencv_test_objdetect
[ 83%] Built target opencv_perf_stitching
[ 83%] Built target opencv_test_stitching
[ 83%] Built target opencv_perf_video
Scanning dependencies of target opencv_gapi
Scanning dependencies of target opencv_interactive-calibration
[ 83%] Built target opencv_test_video
[ 83%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/calibController.cpp.o
[ 83%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/calibPipeline.cpp.o
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to `uuid_parse#UUID_1.0'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to `uuid_generate_random#UUID_1.0'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to `uuid_unparse#UUID_1.0'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to `uuid_copy#UUID_1.0'
collect2: error: ld returned 1 exit status
make[2]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/build.make:122: bin/opencv_test_highgui] Error 1
make[1]: *** [CMakeFiles/Makefile2:2958: modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 83%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/frameProcessor.cpp.o
[ 83%] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/api/grunarg.cpp.o
[ 83%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/main.cpp.o
[ 83%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/parametersController.cpp.o
[ 83%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/rotationConverters.cpp.o
[ 83%] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/api/gorigin.cpp.o
[ 83%] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/api/gmat.cpp.o
[ 83%] Building CXX object modules/gapi/CMakeFiles/opencv_gapi.dir/src/api/garray.cpp.o
[ 83%] Linking CXX executable ../../bin/opencv_interactive-calibration
I found this answer to get the missing libraries, but as I see its for the red hat, and I need it for Ubuntu.
Thanks in advance for any help.
I suppose you are in need of the uuid-dev package. Try running:
sudo apt install uuid-dev

CGAL namespace does not contain data_file_path function

I am using xubuntu20.04 and trying out to compile an example of cgal. for reference, I am working with AABB_tree. CGAL is header only so I copied the include folder to AABB_tree directory. Followed this instruction. when I run make this error is generated-
Scanning dependencies of target AABB_segment_3_example
[ 3%] Building CXX object CMakeFiles/AABB_segment_3_example.dir/AABB_segment_3_example.cpp.o
[ 7%] Linking CXX executable AABB_segment_3_example
[ 7%] Built target AABB_segment_3_example
Scanning dependencies of target AABB_custom_indexed_triangle_set_array_example
[ 10%] Building CXX object CMakeFiles/AABB_custom_indexed_triangle_set_array_example.dir/AABB_custom_indexed_triangle_set_array_example.cpp.o
[ 14%] Linking CXX executable AABB_custom_indexed_triangle_set_array_example
[ 14%] Built target AABB_custom_indexed_triangle_set_array_example
Scanning dependencies of target AABB_polyhedron_facet_distance_example
[ 17%] Building CXX object CMakeFiles/AABB_polyhedron_facet_distance_example.dir/AABB_polyhedron_facet_distance_example.cpp.o
[ 21%] Linking CXX executable AABB_polyhedron_facet_distance_example
[ 21%] Built target AABB_polyhedron_facet_distance_example
Scanning dependencies of target AABB_halfedge_graph_edge_example
[ 25%] Building CXX object CMakeFiles/AABB_halfedge_graph_edge_example.dir/AABB_halfedge_graph_edge_example.cpp.o
[ 28%] Linking CXX executable AABB_halfedge_graph_edge_example
[ 28%] Built target AABB_halfedge_graph_edge_example
Scanning dependencies of target AABB_cached_bbox_example
[ 32%] Building CXX object CMakeFiles/AABB_cached_bbox_example.dir/AABB_cached_bbox_example.cpp.o
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp: In function ‘void triangle_mesh(std::string)’:
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:30:17: error: ‘read_polygon_mesh’ is not a member of ‘CGAL::IO’
30 | if(!CGAL::IO::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh))
| ^~~~~~~~~~~~~~~~~
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp: In function ‘int main(int, char**)’:
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:86:54: error: ‘data_file_path’ is not a member of ‘CGAL’
86 | triangle_mesh<Polyhedron_3>((argc>1)?argv[1]:CGAL::data_file_path("meshes/tetrahedron.off"));
| ^~~~~~~~~~~~~~
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:89:54: error: ‘data_file_path’ is not a member of ‘CGAL’
89 | triangle_mesh<Surface_mesh>((argc>1)?argv[1]:CGAL::data_file_path("meshes/tetrahedron.off"));
| ^~~~~~~~~~~~~~
/home/alvi95/Personal/code/CGAL/examples/AABB_tree/AABB_cached_bbox_example.cpp:92:50: error: ‘data_file_path’ is not a member of ‘CGAL’
92 | surface_mesh_cache_bbox((argc>1)?argv[1]:CGAL::data_file_path("meshes/tetrahedron.off"));
| ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/AABB_cached_bbox_example.dir/build.make:63: CMakeFiles/AABB_cached_bbox_example.dir/AABB_cached_bbox_example.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:266: CMakeFiles/AABB_cached_bbox_example.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
It looks like cgal namespace does not include a data_file_path function. How to fix the problem? Is there any linking problem exist?
I have copied the meshes/tetrahedron.off to the AABB_tree directory. Since the function does not exist, no way to read it.

Cannot find lpublic library

Trying to compile my project on Centos 8.2 using cmake 3.12, im facing with the following error:
cannot find -lpublic
here is full log:
[ 20%] Building CXX object CMakeFiles/ .cpp.o
[ 40%] Building CXX object CMakeFiles/ .cpp.o
[ 60%] Linking CXX shared library .so
[ 60%] Built target myproj
Scanning dependencies of target nist01
[ 80%] Building CXX object CMakeFiles/ .cpp.o
[100%] Linking CXX executable
/usr/bin/ld: cannot find -lpublic
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/nist01.dir/build.make:85: ...] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/...] Error 2
make: *** [Makefile:84: all] Error 2
Tried to find something on the internet, but nothing shown up.
Thanks for your help.
That seems like you try to link against the target "public", which is a suspicious target name. It might be target_link_libraries command with lowercase public instead of uppercase one, like target_link_libraryies(nist01 public something) instead of target_link_libraries(nist01 PUBLIC something).

No rule to make target 'TBB_ENV_LIB_DEBUG-NOTFOUND', needed by 'lib/libopencv_core.so.3.2.0

I'm trying to build opencv with the following CMAKE options:
cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/home/luca/Dropbox/SURFSPM/opencvInstall -D OPENCV_EXTRA_MODULES_PATH=/home/luca/ParallelOpenCV/opencv_contrib/modules -D WITH_TBB=ON -D WITH_OPENMP=ON -D ENABLE_PROFILING=ON ..
Notice that in RELEASE mode OpenCV is correctly compiled with all the other options. However, at 43% it returns this error:
[ 42%] Built target pch_Generate_opencv_perf_optflow
[ 42%] Built target pch_Generate_opencv_test_optflow
[ 43%] Generating precomp.hpp.gch/opencv_structured_light_DEBUG.gch
Scanning dependencies of target opencv_core
[ 43%] Built target pch_Generate_opencv_test_phase_unwrapping
make[2]: *** No rule to make target 'TBB_ENV_LIB_DEBUG-NOTFOUND', needed by 'lib/libopencv_core.so.3.2.0'. Stop.
make[2]: *** Waiting for unfinished jobs....
[ 43%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
cc1plus: warning: /home/luca/ParallelOpenCV/opencv/build/modules/core/precomp.hpp.gch/opencv_core_Release.gch: created with -gnone, but used with -gdwarf-2
[ 43%] Built target pch_Generate_opencv_test_stitching
[ 43%] Built target pch_Generate_opencv_phase_unwrapping
[ 43%] Built target pch_Generate_opencv_test_structured_light
[ 43%] Built target pch_Generate_opencv_perf_stitching
[ 43%] Built target pch_Generate_opencv_stitching
[ 43%] Built target pch_Generate_opencv_structured_light
CMakeFiles/Makefile2:2161: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I think that this is Intel TBB related, but I've installed it (in fact it works with the RELEASE version and I don't know how to solve this.
Like #Tsyvarev's comment hints, indeed the configuration phase fails to pickup a debug library version.
I've gotten success setting the original setting:
TBB_ENV_LIB_DEBUG:FILEPATH=TBB_ENV_LIB_DEBUG-NOTFOUND
To the same value as TBB_ENV_LIB:FILEPATH
//Path to a library.
TBB_ENV_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbb.so
//Path to a library.
TBB_ENV_LIB_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbb.so

building opencv 2.4.6 on Mac - Mavericks

I downloaded opencv 2.4.6 for mac OSX (Mavericks). Untared the tar file and made the following steps:
cd opencv-2.4.6.1/
mkdir build
cd build/
cmake -G "Unix Makefiles" ..
make -j8
But I get an error on the build
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/core/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/imgproc/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(core)
^~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
CV_PERF_TEST_MAIN(imgproc)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/highgui/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(highgui)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
1 error generated.
1 error generated.
make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/imgproc/CMakeFiles/opencv_perf_imgproc.dir/all] Error 2
[ 50%] [ 50%] [ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_perf_highgui.dir/perf/perf_precomp.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_fast.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_descriptors_regression.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_detectors_regression.cpp.o
[ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_ffmpeg.cpp.o
[ 50%] Building CXX object modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o
make[1]: *** [modules/highgui/CMakeFiles/opencv_perf_highgui.dir/all] Error 2
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_fast.cpp.o
[ 50%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_fourcc.cpp.o
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_orb.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/calib3d/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(calib3d)
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_keypoints.cpp.o
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/features2d/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(features2d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note:
expanded from macro 'CV_PERF_TEST_MAIN'
CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bobo/dir/opencv/opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note:
expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS'
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construct...
^ ~~
1 error generated.
make[2]: *** [modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/calib3d/CMakeFiles/opencv_perf_calib3d.dir/all] Error 2
[ 50%] Building CXX object modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_precomp.cpp.o
1 error generated.
make[2]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/perf/perf_main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_framecount.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_main.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_grfmt.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_gui.cpp.o
[ 51%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_matchers_algorithmic.cpp.o
[ 51%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_main.cpp.o
[ 51%] [ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_positioning.cpp.o
Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_mser.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_precomp.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_io.cpp.o
make[1]: *** [modules/features2d/CMakeFiles/opencv_perf_features2d.dir/all] Error 2
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_nearestneighbors.cpp.o
[ 52%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_pos.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_orb.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_precomp.cpp.o
[ 52%] Building CXX object modules/features2d/CMakeFiles/opencv_test_features2d.dir/test/test_rotation_and_scale_invariance.cpp.o
Linking CXX executable ../../bin/opencv_test_highgui
[ 52%] Built target opencv_test_highgui
Linking CXX executable ../../bin/opencv_test_features2d
[ 52%] Built target opencv_test_features2d
make: *** [all] Error 2
I used this compilation options for cmake:
cmake -G "Unix Makefiles" -D CMAKE_INSTALL_PREFIX=/Users/produit/Library/Developer/opencv/ -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_PERF_TESTS=OFF -D BUILD_opencv_legacy=NO ..
It's strange, the bug hase already been reported! http://code.opencv.org/issues/3179
And have already been solved:
https://github.com/Itseez/opencv/pull/1244
Still - for a quick solution:
Open up the
[...]opencv-2.4.6.1/modules/ts/include/opencv2/ts/ts_perf.hpp
Edit around line 480:
with the following:
#if defined(_MSC_VER) && (_MSC_VER <= 1400)
#define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...) \
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/
#else
#define CV_PERF_TEST_MAIN_INTERNALS_ARGS(...) \
__VA_ARGS__;
#endif
#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
CV_PERF_TEST_MAIN_INTERNALS_ARGS(__VA_ARGS__) \'
instead of:
#define CV_PERF_TEST_MAIN_INTERNALS(modulename, impls, ...) \
while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\
Its more or less this change on git:
https://github.com/vkocheganov/opencv/commit/e4b201be25ff92e930b979098e94a89368677313
Worked for me :-)