OpenCV 2.4.13.4 Make Error with Mingw64-GCC-5.1 - opencv

I am trying to compile OpenCV 2.4.13.4 with Mingw64-GCC-5.1 on Windows 10but I keep receiving the following error:
[ 95%] Generating perf_precomp.hpp.gch/opencv_perf_stitching_Release.gch
g++.exe: error: unrecognized command line option '-Wo-array-bounds'
modules\stitching\CMakeFiles\pch_Generate_opencv_perf_stitching.dir\build.make:61: recipe for target 'modules/stitching/perf_precomp.hpp.gch/opencv_perf_stitching_Release.gch' failed
mingw32-make[2]: *** [modules/stitching/perf_precomp.hpp.gch/opencv_perf_stitching_Release.gch] Error 1
CMakeFiles\Makefile2:6569: recipe for target 'modules/stitching/CMakeFiles/pch_Generate_opencv_perf_stitching.dir/all' failed
mingw32-make[1]: *** [modules/stitching/CMakeFiles/pch_Generate_opencv_perf_stitching.dir/all] Error 2
Please note that there is no typo here, -Wo-array-bounds is exactly the output I receive ( and not -Wno-array-bounds that google search suggests!). Any idea how to solve the problem? I searched for -Wo-array-bounds in the entire build folder to possibly change it to -Wno-array-bounds but I couldn't find this command line option in any file located in the build folder.

Related

SWUpdate building error in yocto. make[1]: *** [swupdate_unstripped] Error 1 , make: *** [sub-make] Error 2

I am building custom image in yocto and I want to include SWUpdate in my image but while building the image I am getting a build error of make[1]: *** [swupdate_unstripped] Error 1 and make: *** [sub-make] Error 2 below are the log messages
/swupdate/2021.04-r0/recipe-sysroot/usr/lib/liblua5.1.a(loadlib.o): undefined reference to symbol 'dlsym##GLIBC_2.17'
/swupdate/2021.04-r0/recipe-sysroot/lib/libdl.so.2: error adding symbols: DSO missing from command line
/swupdate/2021.04-r0/git/Makefile:421: recipe for target 'swupdate_unstripped' failed
I searched the internet about the error I am getting, and according to it if u-boot version and swupdate version are not compatible then the following error occures. But in my case both the swupdate is at its latest verson and even u-boot is at latest version.
I added meta-swupdate in bblayers.config and added swupdate, swupdate-www in IMAGE_INSTALL to add the swupdate in image.

Why does the build fail trying to find boost.hpp?

I am trying to build IoTivity for iOS and following the instructions here but I keep getting this error which terminates the build.
service/resource-encapsulation/include/RCSException.h:33:10: fatal error: 'boost/config.hpp'
file not found
#include <boost/config.hpp>
^~~~~~~~~~~~~~~~~~
1 error generated.
scons: *** [out/ios/arm64/debug/service/resource-encapsulation/src/common/expiryTimer/src/ExpiryTimerImpl.o] Error 1
scons: building terminated because of errors.
When I look in my boost framework, I do see the config.hpp file. Does anyone have any ideas why it would be unable to find the file.

Adding Library to CMake on CLI

I'm trying to build OpenCV with CUDA support using Arch Linux's AUR. In their build configuration some options are passed to CMake, I have modified those to add CUDA features. Upon attempting compilation I get the following error:
[ 10%] Built target pch_Generate_opencv_reg
In file included from /home/meurer/Downloads/opencv-git/src/modules/cudacodec/opencv_cudacodec_pch_dephelp.cxx:1:0:
/home/meurer/Downloads/opencv-git/src/opencv/modules/cudacodec/src/precomp.hpp:59:14: fatal error: dynlink_nvcuvid.h: No such file or directory
#include <dynlink_nvcuvid.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [modules/cudacodec/CMakeFiles/opencv_cudacodec_pch_dephelp.dir/build.make:63: modules/cudacodec/CMakeFiles/opencv_cudacodec_pch_dephelp.dir/opencv_cudacodec_pch_dephelp.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6834: modules/cudacodec/CMakeFiles/opencv_cudacodec_pch_dephelp.dir/all] Error 2
I searched my filesystem and found the rogue header file in /usr/include/nvidia-sdk/dynlink_nvcuvid.h. Due to how AUR works, I believe I can only configure CMake via command line options (See links 1, 2 under _cmakeopts=...).
What argument can I pass to CMake to make it search for the appropriate libraries under the aforementioned directory, as well as the ones it already uses?

Compiling ROS Kinetec from source fails when building opencv

I'm using an Arch machine and trying to compile ROS desktop full from source. The build fails when image_proc is trying to link executable.
Here is the error log:
[ 23%] Built target image_proc_gencfg
[ 84%] Built target image_proc
[ 92%] Linking CXX executable /home/alphayed/ROS/ros_catkin_ws/devel_isolated/image_proc/lib/image_proc/image_proc
/home/alphayed/ROS/ros_catkin_ws/install_isolated/lib/libopencv_viz3.so.3.1.0: undefined reference to `vtkSTLReader::New()'
/home/alphayed/ROS/ros_catkin_ws/install_isolated/lib/libopencv_viz3.so.3.1.0: undefined reference to `vtkOBJReader::New()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/image_proc_exe.dir/build.make:219: /home/alphayed/ROS/ros_catkin_ws/devel_isolated/image_proc/lib/image_proc/image_proc] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/image_proc_exe.dir/all] Error 2
make: *** [Makefile:139: all] Error 2
I think the problem is related to opencv3. I removed it from the system and recompiled it from source but that didn't solve the issue. Can you please help?
I have found a fix as per this thread. You need to modify opencv3/cmake/OpenCVDetectVTK.cmake, for every find_package(VTK QUIET COMPONENTS ... add an entry vtkIOGeometry

Mingw doesn't find file strsafe.h while compiling OpenVC library

I want start playing with the OpenCV library, but I have a problem during the build process. I am on Windows 10 with the Mingw compiler. When I launch the command mingw32-make after a while, I get the following errors:
C:\Github\opencv\modules\videoio\src\cap_dshow.cpp:337:21: fatal error: strsafe.h: No such file or directory
#include <strsafe.h>
^
compilation terminated.
modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:187: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dshow.cpp.obj' failed
mingw32-make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dshow.cpp.obj] Error 1
CMakeFiles\Makefile2:4340: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
mingw32-make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
The incriminated file is cap_dshow.cpp, and the compiler says that is missing the header file strsafe.h. Inside the folder C:\MinGW\include this file is not present and I don't know where to find this.
I've installed MinGW compiler (and other things) with a tool called "MinGW Installation Manager". With this tool I can install also other libraries, but I don't know if one of these contains the file strsafe.h.
My question is likely a duplicate of this, but the accepted answer has a broken link.
I have Microsoft SDK installed and found the strsafe.h file in "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin".
Adding "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin" to the Path system environment variable worked.

Resources