Can't build OpenCV 3.1 on Windows (using MinGW) - opencv

I need to build OpenCV from source, because I want to make modifications to it. So using pre-built binaries is not an option for me. I'm doing this on Windows 8. I do not have MS Visual Studio, and I don't want to use it.
Here is how I reproduce the build error:
I git clone https://github.com/opencv/opencv
I use CMake 3.7.1, press Configure, then press Generate. It seems to work (no errors). I named the output folder opencv/release.
I go to the opencv/release folder, and type mingw32-make.
Eventually, after compiling for a while, it displays the following error message:
Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj
modules\core\src\parallel.cpp:135:43: error: operator '&&' has no right operand
modules\core\src\parallel.cpp: In function 'void cv::parallel_for_(const cv::Range&, const cv::ParallelLoopBody&, double)':
modules\core\src\parallel.cpp:311:52: error: 'parallel_for_pthreads' was not declared in this scope parallel_for_pthreads(range, body, nstripes);
^
modules\core\src\parallel.cpp: In function 'int cv::getNumThreads()':
modules\core\src\parallel.cpp:370:50: error: 'parallel_pthreads_get_threads_num' was not declared in this scope return parallel_pthreads_get_threads_num();
^
modules\core\src\parallel.cpp: In function 'void cv::setNumThreads(int)':
modules\core\src\parallel.cpp:431:46: error: 'parallel_pthreads_set_threads_num' was not declared in this scope parallel_pthreads_set_threads_num(threads);
^
modules\core\CMakeFiles\opencv_core.dir\build.make:990: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj' failed mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/src/parallel.cpp.obj] Error 1
Note: I tried to compile both with and without TPP (in the CMake config), and I get the same error message.
Also, I read the other similar questions on StackOverflow and the answers do not help.

Related

Unable to run flutter app on device with flutter_facebook_auth

I am trying to implement login with facebook in my Flutter app. It seems the library to do so is https://pub.dev/packages/flutter_facebook_auth/install .
I followed all the installation instructions - and I am able to correctly run the app in the iPhone simulator. I am unable to run the app on my own device. The XCode build completes successfully, i.e. flutter build ios works but flutter run -d XXXXXXXX-XXXXXXXXXXXXXXXX (device ID snipped) fails with a lot of errors, here is some of the output of flutter run (see below).
How do I get this to run on my device?
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:52: error: reference to 'FBSDKSettings' is ambiguous
settings:(id<FBSDKSettings>)settings
^
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:34:
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKSettings+SettingsProtocols.h:22:
/Users/imrigoldberg/Documents/flytrex/shopper/build/ios/Debug-iphoneos/FBSDKCoreKit/FBSDKCoreKit.framework/PrivateHeaders/FBSDKSettingsProtocol.h:23:11: note: candidate found by name lookup is 'FBSDKSettings'
#protocol FBSDKSettings
^
In file included from /Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:31:
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettingsProtocol.h:23:11: note: candidate found by name lookup is 'FBSDKSettings'
#protocol FBSDKSettings
^
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:52: error: type argument 'FBSDKSettings' must be a pointer (requires a '*')
settings:(id<FBSDKSettings>)settings
^
*
/Users/imrigoldberg/Documents/flytrex/shopper/ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/Instrument/FBSDKInstrumentManager.m:58:49: error: type arguments cannot be applied to non-class type 'id'
settings:(id<FBSDKSettings>)settings
^ ~~~~~~~~~~~~~~~
2 warnings and 14 errors generated.

Does bazel support public.xml when build an android project

I'm migrating from gradle, and I'm using public.xml on my android project, it works fine with gradle, but when I build it with bazel, it failed with the following error:
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6772: error: Public symbol drawable/skin_at declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6774: error: Public symbol drawable/skin_at_click declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6776: error: Public symbol drawable/skin_face declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6778: error: Public symbol drawable/skin_face_click declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6780: error: Public symbol drawable/skin_keyboard declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6782: error: Public symbol drawable/skin_keyboard_click declared here is not defined.
What should I do here to solve this problem?
Thanks very much for any help!
Bazel 0.4.5 (the current version at time of writing) does not support private resources and public.xml files. This is because this functionality is implemented by Gradle, not the underlying tools (aapt). There is an open feature request for Bazel to reimplement this feature of Gradle here: https://github.com/bazelbuild/bazel/issues/2124.

OpenCV linemod not cv member

I try to install a ROS indigo package jsk_recognition for chessboard detection and relative position, I have opencv-3.0.0-rc1 on Ubuntu 14.04. When I try to catkin_make the package I receive build errors, quit a lot, the full report is here, but it starts like:
[ 73%] Building CXX object
vision/jsk_recognition-master/jsk_perception/CMakeFiles/roi_to_mask_image.dir/roi_to_mask_image.cpp.o
/home/elod/catkin_ws/src/vision/jsk_recognition-master/jsk_perception/src/linemod.cpp:69:57:
error: ‘linemod’ is not a member of ‘cv’ std::vector<CvPoint>
maskFromTemplate(const std::vector<cv::linemod::Template>& templates,
^ /home/elod/catkin_ws/src/vision/jsk_recognition-master/jsk_perception/src/linemod.cpp:69:57:
error: ‘linemod’ is not a member of ‘cv’
/home/elod/catkin_ws/src/vision/jsk_recognition-master/jsk_perception/src/linemod.cpp:69:78:
error: template argument 1 is invalid std::vector<CvPoint>
maskFromTemplate(const std::vector<cv::linemod::Template>& templates,
^
/home/elod/catkin_ws/src/vision/jsk_recognition-master/jsk_perception/src/linemod.cpp:69:78:
error: template argument 2 is invalid
/home/elod/catkin_ws/src/vision/jsk_recognition-master/jsk_perception/src/linemod.cpp:69:57:
error: ‘linemod’ is not a member of ‘cv’ std::vector<CvPoint>
maskFromTemplate(const std::vector<cv::linemod::Template>& templates,
the problem seams to be with the linemod class, which in the online opencv documentation exist but in my case the compiler does not recognise it. The linemod.h header file can't be find in any opencv folder only in:
./home/elod/catkin_ws/src/vision/jsk_recognition-master/jsk_pcl_ros/include/jsk_pcl_ros/linemod.h
./opt/ros/indigo/include/jsk_pcl_ros/linemod.h
./usr/include/pcl-1.7/pcl/recognition/linemod.h
Is this module missing somhow my OpenCV installation or why cant find it in the cv namespace?
In my old Opencv 2.4.11 (uninstalled) seams to be included this module, but I migrated all my stuff to 3.0.0.
Any ideas how to solve it?
UPDATE
A very important observation is that the above mentioned pkg is for Opencv2.4 and I'm using 3.0! Some stuff was moved or removed from the new version like cvSnakeImage, which also appears in this pkg.
An other question would be: how to replace the cvSnakeImage or with what can be replaced?
Did you build from scratch (clean build directory) ?
You could try adding cv:: namespace into *.hpp
-<linemod::Match>
+<cv::linemod::Match>
And/or try adding "#include <opencv2/rgbd/linemod.hpp>" into the same file.

Error Cross Compiling: hidden symbol ... final link failed

I am getting the following error when compiling opencv with ffmpeg.
..../arm-none-linux-gnueabi/bin/ld: ../../bin/opencv_test_core: hidden symbol `__sync_val_compare_and_swap_4' in ..../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
I have no idea what this means. How do I fix this?
Edit:
I am cross compiling for ARM using codesourcery's arm-2009q3 compiler.
I using cmake and make to compile.
Please check all the libraries that you use and go through this stackoverflow thread as well.
To me, I got the below error when I migrated my product to new GCC version (3.3.3 to 4.5.4)
hidden symbol `__clz_tab' in /../lib/gcc/mipsel-unknown-linux-uclibc/4.5.4/libgcc.a(_clz.o) is referenced by DSO
Later I found that one of the library that I tried to link was built using GCC 3.3.3. After building the other library under GCC 4.5.4, the 'hidden symbol' error disappeared.

fail to build Opencv in windows using code:block

Following this link. I am stuck in the last two steps during setting up my workstation.
As a compiler I use Code:Block MinGW; I have already generated the compiled opencv files, now I need to build the sln file in Windows. I use Code Block to build this OpenCV Project File in the path D:\OpenCV\Build\Opencv, where I put the generated bin file after using Cmake.
During the building, it stopped at 40%, saying;
Linking CXX executable ....\bin\opencv_perf_core.exe
c:/codeblock/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe:
warning: auto-importing has been activated without
--enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from
auto-imported DLLs. Cannot export _ZN12_GLOBAL__N_13ROp3allEv: symbol
not found Cannot export _ZN12_GLOBAL__N_17CmpType3allEv: symbol not
found collect2: ld returned 1 exit status mingw32-make.exe[2]: *
[bin/opencv_perf_core.exe] Error 1 mingw32-make.exe1: *
[modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
mingw32-make.exe: * [all] Error 2 Info: resolving vtable for
cv::_OutputArray by linking to imp_ZTVN2cv12_OutputArrayE
(auto-import) Info: resolving vtable for cv::_InputArray by linking to
imp_ZTVN2cv11_InputArrayE (auto-import) Info: resolving vtable for cv::Exception by linking to imp_ZTVN2cv9ExceptionE (auto-import)
Creating library file: ....\bin\libopencv_perf_core.dll.a Process
terminated with status 2 (14 minutes, 29 seconds) 0 errors, 3 warnings
How can I solve this problem?
Unfortunately, there's not much you can do, according to http://code.opencv.org/issues/2523.
You will have to use a recent version of MinGW. It builds fine using the latest MinGW shipping with GCC 4.7.2.
This issue seems to have been introduced in OpenCV 2.4.3 as it is said version 2.4.2 builds fine.

Resources