Compilation of OpenCV 3.1.0 videoio error - opencv

Im trying to compile Opencv 3.1.0 with MingW 4.9.2 but i have the follow error
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_dsho
w.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
I found that is a OpenCV build error during cap_dshow.cpp build. The solution showed here is no necessary because the file in Opencv 3.1 is already fixed.
During Cmake phase i've changed this (trough Cmake GUI 3.4.3), but doesnt work
CMAKE_BUILD_TYPE = Debug
WITH_EIGEN = 0
WITH_OPENGL = 0
WITH_IPP = 0
WITH_QT = 1
I've tried the solution given in this post, but doesnt work neither
add_extra_compiler_option(-Werror=non-virtual-dtor)
My intention is work with C++, Opencv and the GUI designer of QT. I have installed the library qt-5.4.0-x64-mingw492r0-sjlj, it comes with its own MingW 4.9.2.
(PS/for another proyect i've compiled Opencv3.1.0 with Mingw 4.9.3 and its works perfectly)
Can anybody helpme please!!!

In file %OPENCV_HOME%\sources\modules\videoio\src\cap_dshow.cpp
Add in top:
#define STRSAFE_NO_DEPRECATE
Work for me in Qt 5.6.2, Mingw 4.9.2 OpenCV 3.2.0

Related

When trying to build Halide on Linux system with llvm-10.0 on release/10.x and master branches, facing the below issue

[ 53%] Linking CXX executable test_function_dag
/bin/ld: ../../libHalide.so.10.0.0: undefined reference to `typeinfo for llvm::SectionMemoryManager'
collect2: error: ld returned 1 exit status
make[2]: *** [src/autoschedulers/adams2019/CMakeFiles/test_function_dag.dir/build.make:134: src/autoschedulers/adams2019/test_function_dag] Error 1
make[1]: *** [CMakeFiles/Makefile2:2328: src/autoschedulers/adams2019/CMakeFiles/test_function_dag.dir/all] Error 2
make: *** [Makefile:182: all] Error 2
I'm using pre-built LLVM binaries and below cmake command to configure
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=/home/harry/llvm/lib/cmake/llvm ../
Any advice and suggestions will be greatly appreciated.
I cloned Halide from release/10.x, and compiled against the LLVM 10.0.0 binaries obtained here. On Ubuntu 20.04 LTS, I had to also apt install libtinfo5 because these binaries are built against old system libraries.
I noticed that the official binaries are not built with RTTI enabled (ugh) and was able to repro and fix. There's a bug in dependencies/llvm/CMakeLists.txt. Find the line that reads:
$<$<COMPILE_LANG_AND_ID:CXX,GCC,Clang,AppleClang>:-fno-rtti>)
and change GCC to GNU. We don't test with non-RTTI LLVM, which is why this wasn't caught.

Torch with CUDA10

I am trying to install torch with cuda10 on my raspberry pi. I am following the following github thread ( answer of nagadomi:
https://github.com/torch/cutorch/issues/834
Following all his steps still when I run ./install.sh
I get the following error
make[2]: * No rule to make target 'exe/luajit-rocks/luajit-2.1/src/lib_ffi.c', needed by 'exe/luajit-rocks/luajit-2.1/vmdef.lua'. Stop.
make[1]: * [CMakeFiles/Makefile2:212: exe/luajit-rocks/luajit-2.1/CMakeFiles/luajit-static.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
./install.sh: line 107: /home/pi/torch/install/bin/luarocks: No such file or directory
Installing common Lua packages
./install.sh: line 111: /home/pi/torch/install/bin/luarocks: No such file or directory
I have now spent a week just trying to setup torch with CUDA.
Basically I need cutorch library and it is not installing from `luarocks install cutorch
Can anyone help me please?

Armadillo compiler error

I am using armadillo C++ library. I see below error when doing the compile. Does it require new version of GCC compiler I am having "gcc version 4.1.2" right now with my system
[ 50%] Building CXX object CMakeFiles/armadillo.dir/src/wrapper.cpp.o
In file included from /home/mukuar01/armadillo/armadillo-7.800.3/src/wrapper.cpp:29:
/home/mukuar01/armadillo/armadillo-7.800.3/tmp/include/armadillo_bits/compiler_setup.hpp:168:6: error: #error "*** Need a newer compiler ***"
make[2]: *** [CMakeFiles/armadillo.dir/src/wrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
make: *** [all] Error 2
Yes, you do need a newer version of gcc. At least version 4.4.0 is required. You can check in the source code, line 167. Versions 4.7.0 and 4.7.1 are also not supported due to a bug.
You could try to use clang instead of gcc, but not sure which version is needed.
Or you could try with older versions of armadillo, but I am not sure how far you'd need to go back.

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.

"unable to find utility g++" while trying to compile a MobileSubstrate tweak with Theos (OSX)

OSX Yosemite 10.10.2
I recently installed Theos following this guide, got no problems. However when I try to compile a simple MS tweak, I get this error in Terminal.app:
MBP:noeditnc ned$ cd /Users/ned/noeditnc
MBP:noeditnc ned$ make
Making all for tweak NoEditNC...
Preprocessing Tweak.xm...
Compiling Tweak.xm (armv7)...
xcrun: error: unable to find utility "clang++", not a developer tool or in PATH
make[3]: *** [.theos/obj/armv7/Tweak.xm.5e67a2f0.o] Error 72
make[2]: *** [.theos/obj/armv7/NoEditNC.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [NoEditNC.all.tweak.variables] Error 2
I have Command Line Tools and Xcode both installed and updated to the latest version. Google couldn't help... What am I doing wrong?
EDIT: Clang++ is installed.
MBP:noeditnc ned$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
EDIT 2: Found a solution! I had the wrong sdk version number in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ (iPhoneOS8.1 instead of iPhoneOS8.2)

Resources