<hr>
<p dir="auto"><strong>STOP READING NOW</strong></p>
<p dir="auto">If you get the error message from the caption, because it is useless and too generic (are you sure that you build OpenCV library and not other make project?).<br>
Reason of your build problem is somewhere above this line, you need to grab it instead.<br>
To get right error message you should run "make" in verbose mode:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ make VERBOSE=1"><pre class="notranslate"><code class="notranslate">$ make VERBOSE=1
</code></pre></div>
<p dir="auto">(without any -j options to prevent message lines mess)</p>
<hr>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 3.1</li>
<li>Operating System / Platform =&gt; Elementary OS (Loki)</li>
<li>Compiler =&gt; make</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<ul dir="auto">
<li>When I did just <code class="notranslate">cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..</code>, <code class="notranslate">make -j4</code> worked all right```</li>
<li>When I tried to <code class="notranslate">make -j4 VERBOSE=1</code> with Examples and Modules, I got this error</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="...
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/build.make modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 28%] Built target opencv_surface_matching
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 28%] Built target example_surface_matching_ppf_load_match
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 28%] Built target example_surface_matching_ppf_normal_computation
make -f modules/video/CMakeFiles/opencv_video.dir/build.make modules/video/CMakeFiles/opencv_video.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video/CMakeFiles/opencv_video.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/video/CMakeFiles/opencv_video.dir/build.make modules/video/CMakeFiles/opencv_video.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/video/CMakeFiles/opencv_video.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 29%] Built target opencv_video
make -f modules/video/CMakeFiles/opencv_test_video.dir/build.make modules/video/CMakeFiles/opencv_test_video.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video/CMakeFiles/opencv_test_video.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/video/CMakeFiles/opencv_test_video.dir/build.make modules/video/CMakeFiles/opencv_test_video.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/video/CMakeFiles/opencv_test_video.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 30%] Built target opencv_test_video
make -f modules/video/CMakeFiles/opencv_perf_video.dir/build.make modules/video/CMakeFiles/opencv_perf_video.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video/CMakeFiles/opencv_perf_video.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/video/CMakeFiles/opencv_perf_video.dir/build.make modules/video/CMakeFiles/opencv_perf_video.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/video/CMakeFiles/opencv_perf_video.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 31%] Built target opencv_perf_video
make -f modules/dnn/CMakeFiles/opencv_dnn.dir/build.make modules/dnn/CMakeFiles/opencv_dnn.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn/CMakeFiles/opencv_dnn.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/dnn/CMakeFiles/opencv_dnn.dir/build.make modules/dnn/CMakeFiles/opencv_dnn.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/dnn/CMakeFiles/opencv_dnn.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 33%] Built target opencv_dnn
make -f modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build.make modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends &quot;Unix Makefiles&quot; /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build.make modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 33%] Linking CXX executable ../../bin/example_dnn_fcn_semsegm
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn &amp;&amp; /usr/bin/cmake -E cmake_link_script CMakeFiles/example_dnn_fcn_semsegm.dir/link.txt --verbose=1
/usr/bin/c++      -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security  -Wundef -Winit-self -Wpointer-arith -Wshadow  -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-parentheses -Wno-maybe-uninitialized -Wno-sign-promo -Wno-missing-declarations -O3 -DNDEBUG  -DNDEBUG      CMakeFiles/example_dnn_fcn_semsegm.dir/samples/fcn_semsegm.cpp.o  -o ../../bin/example_dnn_fcn_semsegm -rdynamic ../../lib/libopencv_dnn.so.3.1.0 ../../lib/libopencv_highgui.so.3.1.0 ../../lib/libopencv_videoio.so.3.1.0 ../../lib/libopencv_imgcodecs.so.3.1.0 ../../lib/libopencv_imgproc.so.3.1.0 ../../lib/libopencv_core.so.3.1.0 -Wl,-rpath,/home/flipswitch/Programs/anaconda3/pkgs/opencv/build/lib 
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) const'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;))'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, google::protobuf::io::CodedOutputStream*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned char*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::empty_string_[abi:cxx11]'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, google::protobuf::io::CodedOutputStream*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, google::protobuf::io::CodedOutputStream*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const*, google::protobuf::internal::ArenaStringPtr)'
collect2: error: ld returned 1 exit status
modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build.make:100: recipe for target 'bin/example_dnn_fcn_semsegm' failed
make[2]: *** [bin/example_dnn_fcn_semsegm] Error 1
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
CMakeFiles/Makefile2:3094: recipe for target 'modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/all' failed
make[1]: *** [modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/all] Error 2
make[1]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

"><pre class="notranslate"><code class="notranslate">...
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/build.make modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/surface_matching/CMakeFiles/opencv_surface_matching.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 28%] Built target opencv_surface_matching
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/surface_matching/CMakeFiles/example_surface_matching_ppf_load_match.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 28%] Built target example_surface_matching_ppf_load_match
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build.make modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/surface_matching/CMakeFiles/example_surface_matching_ppf_normal_computation.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 28%] Built target example_surface_matching_ppf_normal_computation
make -f modules/video/CMakeFiles/opencv_video.dir/build.make modules/video/CMakeFiles/opencv_video.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video/CMakeFiles/opencv_video.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/video/CMakeFiles/opencv_video.dir/build.make modules/video/CMakeFiles/opencv_video.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/video/CMakeFiles/opencv_video.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 29%] Built target opencv_video
make -f modules/video/CMakeFiles/opencv_test_video.dir/build.make modules/video/CMakeFiles/opencv_test_video.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video/CMakeFiles/opencv_test_video.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/video/CMakeFiles/opencv_test_video.dir/build.make modules/video/CMakeFiles/opencv_test_video.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/video/CMakeFiles/opencv_test_video.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 30%] Built target opencv_test_video
make -f modules/video/CMakeFiles/opencv_perf_video.dir/build.make modules/video/CMakeFiles/opencv_perf_video.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/video/CMakeFiles/opencv_perf_video.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/video/CMakeFiles/opencv_perf_video.dir/build.make modules/video/CMakeFiles/opencv_perf_video.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/video/CMakeFiles/opencv_perf_video.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 31%] Built target opencv_perf_video
make -f modules/dnn/CMakeFiles/opencv_dnn.dir/build.make modules/dnn/CMakeFiles/opencv_dnn.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn/CMakeFiles/opencv_dnn.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/dnn/CMakeFiles/opencv_dnn.dir/build.make modules/dnn/CMakeFiles/opencv_dnn.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make[2]: Nothing to be done for 'modules/dnn/CMakeFiles/opencv_dnn.dir/build'.
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 33%] Built target opencv_dnn
make -f modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build.make modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/depend
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/flipswitch/Programs/anaconda3/pkgs/opencv /home/flipswitch/Programs/anaconda3/pkgs/opencv_contrib/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
make -f modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build.make modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build
make[2]: Entering directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
[ 33%] Linking CXX executable ../../bin/example_dnn_fcn_semsegm
cd /home/flipswitch/Programs/anaconda3/pkgs/opencv/build/modules/dnn &amp;&amp; /usr/bin/cmake -E cmake_link_script CMakeFiles/example_dnn_fcn_semsegm.dir/link.txt --verbose=1
/usr/bin/c++      -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security  -Wundef -Winit-self -Wpointer-arith -Wshadow  -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-parentheses -Wno-maybe-uninitialized -Wno-sign-promo -Wno-missing-declarations -O3 -DNDEBUG  -DNDEBUG      CMakeFiles/example_dnn_fcn_semsegm.dir/samples/fcn_semsegm.cpp.o  -o ../../bin/example_dnn_fcn_semsegm -rdynamic ../../lib/libopencv_dnn.so.3.1.0 ../../lib/libopencv_highgui.so.3.1.0 ../../lib/libopencv_videoio.so.3.1.0 ../../lib/libopencv_imgcodecs.so.3.1.0 ../../lib/libopencv_imgproc.so.3.1.0 ../../lib/libopencv_core.so.3.1.0 -Wl,-rpath,/home/flipswitch/Programs/anaconda3/pkgs/opencv/build/lib 
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) const'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;))'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, google::protobuf::io::CodedOutputStream*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned char*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::empty_string_[abi:cxx11]'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, google::protobuf::io::CodedOutputStream*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, google::protobuf::io::CodedOutputStream*)'
../../lib/libopencv_dnn.so.3.1.0: undefined reference to `google::protobuf::internal::ArenaStringPtr::AssignWithDefault(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const*, google::protobuf::internal::ArenaStringPtr)'
collect2: error: ld returned 1 exit status
modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/build.make:100: recipe for target 'bin/example_dnn_fcn_semsegm' failed
make[2]: *** [bin/example_dnn_fcn_semsegm] Error 1
make[2]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
CMakeFiles/Makefile2:3094: recipe for target 'modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/all' failed
make[1]: *** [modules/dnn/CMakeFiles/example_dnn_fcn_semsegm.dir/all] Error 2
make[1]: Leaving directory '/home/flipswitch/Programs/anaconda3/pkgs/opencv/build'
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2


</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<ul dir="auto">
<li>Downloaded opencv and opencv_contrib</li>
<li>Then <code class="notranslate">cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/Programs/anaconda3/pkgs/opencv_contrib/modules -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_IPP=OFF ..</code></li>
<li>Followed by <code class="notranslate">make -j4 VERBOSE=1</code></li>
<li>First time I tried without using <code class="notranslate">WITH_IPP=OFF</code>, it reached 50% and errored out with the same error.</li>
<li>Next time I tried with it and it errored out at 23%</li>
</ul>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; :4.0.0.21:</li>
<li>Operating System / Platform =&gt; : windows10:</li>
<li>Compiler =&gt; :pre-build version from pip:</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">background: i wanna achieve opencv dnn model to detect face in an image<br>
after accessing the model and prototxt from <a href="https://github.com/opencv/opencv_extra/blob/master/testdata/dnn/download_models.py">opencv_extra/testdata/dnn/download_models.py</a>, i learned some sample code to test whether it works or not.  And then, I got the following info:</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[libprotobuf ERROR C:\projects\opencv-python\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 2:1: Invalid control characters encountered in text.
[libprotobuf ERROR C:\projects\opencv-python\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 2:2: Interpreting non ascii codepoint 162.
[libprotobuf ERROR C:\projects\opencv-python\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 2:2: Expected identifier, got: ?
Traceback (most recent call last):
  File &quot;src/facedetect/detector.py&quot;, line 103, in &lt;module&gt;
    util.gainFaceByDNN(path, modelpath, deploypath)
  File &quot;src/facedetect/detector.py&quot;, line 26, in gainFaceByDNN
    net = cv2.dnn.readNetFromCaffe(modelFile, configFile)
cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\dnn\src\caffe\caffe_io.cpp:1151: error: (-2:Unspecified error) FAILED: ReadProtoFromTextFile(param_file, param). Failed to parse NetParameter file: D:\project\python\IQA\src\facedetect\res10_300x300_ssd_iter_140000.caffemodel in function 'cv::dnn::ReadNetParamsFromTextFileOrDie'"><pre class="notranslate"><code class="notranslate">[libprotobuf ERROR C:\projects\opencv-python\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 2:1: Invalid control characters encountered in text.
[libprotobuf ERROR C:\projects\opencv-python\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 2:2: Interpreting non ascii codepoint 162.
[libprotobuf ERROR C:\projects\opencv-python\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_caffe.NetParameter: 2:2: Expected identifier, got: ?
Traceback (most recent call last):
  File "src/facedetect/detector.py", line 103, in &lt;module&gt;
    util.gainFaceByDNN(path, modelpath, deploypath)
  File "src/facedetect/detector.py", line 26, in gainFaceByDNN
    net = cv2.dnn.readNetFromCaffe(modelFile, configFile)
cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\dnn\src\caffe\caffe_io.cpp:1151: error: (-2:Unspecified error) FAILED: ReadProtoFromTextFile(param_file, param). Failed to parse NetParameter file: D:\project\python\IQA\src\facedetect\res10_300x300_ssd_iter_140000.caffemodel in function 'cv::dnn::ReadNetParamsFromTextFileOrDie'
</code></pre></div>
<p dir="auto">i have tried to google error, and got some solutions to try but they all failed, including checking the invisible content of the deploy.prototxt, redownload the files, etc.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">below is the code i used for test and it goes wrong on the first code.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="net = cv2.dnn.readNetFromCaffe(modelFile, configFile)
image = cv2.imread(imgPath)
(h, w) = image.shape[:2]

blob = cv2.dnn.blobFromImage(cv2.resize(image, (300,300)), 1.0, (300,300), (103.93, 116.77, 123.68), False)
net.setInput(blob)

detections = net.forward()"><pre class="notranslate"><code class="notranslate">net = cv2.dnn.readNetFromCaffe(modelFile, configFile)
image = cv2.imread(imgPath)
(h, w) = image.shape[:2]

blob = cv2.dnn.blobFromImage(cv2.resize(image, (300,300)), 1.0, (300,300), (103.93, 116.77, 123.68), False)
net.setInput(blob)

detections = net.forward()
</code></pre></div>
<p dir="auto">Is there any practical solutions ? thanks ~</p>