Currently I am trying to implement OpenCV into my Swift app and when I go to build the project I get a parse issue. It says there is an expected identifier in files "exposure_compensate.hpp" and "blenders.hpp". To implement OpenCV I have created a bridge-header and an Objective-C wrapper for OpenCV's C++ code just like you're supposed to. The compiler says that it is failing because it detected a macro "NO" definition during the build but I have no idea what could be causing it to do that. One source suggested that I include a prefix.pch file to my project but I don't know how to point Swift to the prefix.pch file. Any suggestions on what I should do? Any help would be appreciated.
OpenCV Parse Issue
Same here...😐
I've added opencv as follows
- Download it and build it
git clone https://github.com/opencv/opencv cd opencv mkdir build && cd build cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=../install .. sudo make -j$(sysctl -n hw.logicalcpu) sudo make install - Go to
install - Copy all
.afiles fromlibandlib/opencv4/3rdparty/into your project. I.e.MyProject/Libraries/ - Get to
install/include/opencv4/and copy theopencv2folder into your project. - Go to your project settings Targets -> Search Paths -> Header Search Paths
- Add the following path
$(PROJECT_DIR)/Path/to/opencv2/
NOTE: I currently have a problem with my Xcode and I guess it's related to opencv, so you may also encounter this issue.
Ryan