How to successfully bind OpenCV 3.4 iOS with Objective Sharpie 3.4.0?

Hello,

I'm trying to generate bindings with Objective Sharpie 3.4.0 for OpenCV 3.4.0 iOS but have no success so far. Maybe someone can give me some hints what I'm doing wrong.

My source:

  • OpenCV 3.4.0 iOS Pack (have a look at opencv releases => iOS pack), which contains a *.framework directory with headers and an .a fat library (without extra opencv_contrib modules).
  • Alternatively I successfully compiled my own OpenCV 3.4.0 version with opencv_contrib modules from source. Both behave the same regarding issues.

Other tools/versions:

  • Iphone11.2 SDK

What I tried:
I tried the following sharpie parameters (when current dir contains opencv2.framework):

$ sharpie bind -framework opencv2
$ Done. Exiting with error code 1.
error: opencv2: Umbrella header file does not exist: opencv2.framework/Headers/opencv2.h
$

That is because the umbrella file is Headers/opencv.hpp. So i changed the parameters to:

$ sharpie bind -fx-umbrella opencv2.framework/Headers/opencv.hpp -framework opencv2
Done. Exiting with error code 1.
error: opencv2: Umbrella header file does not exist: opencv2.framework/Headers/opencv2.h
$

which completely gets ignored in every order.

I also tried many other possibilities like defining only the .a file (in combination with removing included libs with lipo):

$ sharpie bind opencv2.a
Parsing 1 header files...
warning: [SomePath]/opencv2.a: 'linker' input unused [-Wunused-command-line-argument]
warning: argument unused during compilation: '-c' [-Wunused-command-line-argument]
warning: argument unused during compilation: '-fno-spell-checking' [-Wunused-command-line-argument]
warning: argument unused during compilation: '-Xclang -detailed-preprocessing-record' [-Wunused-command-line-argument]
error: unable to handle compilation, expected exactly one compiler job in ''
Error while processing [SomePath]/opencv2.a.
Done. Exiting with error code 1.
error: Clang failed to parse input and exited with code 1
$

or addressing the umbrella header directly with:

$ sharpie bind Headers/opencv.hpp

which fails because "opencv2/...hpp" file not found because every included hpp refers to "opencv2/..." structure

Answers

Sign In or Register to comment.