<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.0.0-alpha, 4.0.0-beta</li>
<li>Operating System / Platform =&gt; Ubuntu 16.04</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">Since OpenCV 4.0.0-alpha, I cannot use anymore <code class="notranslate">Features2d.NOT_DRAW_SINGLE_POINTS</code> with Java binding.</p>
<p dir="auto">Is this intended since it looks like it is no more possible to call <code class="notranslate">drawMatches</code> with this flag parameter?</p>
<p dir="auto">In <a href="https://docs.opencv.org/3.4.3/javadoc/org/opencv/features2d/Features2d.html" rel="nofollow">3.4.3</a>, there is:<br>
<code class="notranslate">drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask, int flags)</code></p>
<p dir="auto">But in <a href="https://docs.opencv.org/4.0.0-beta/javadoc/org/opencv/features2d/Features2d.html" rel="nofollow">4.0.0-beta</a> there is only:<br>
<code class="notranslate">drawMatches(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, MatOfDMatch matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, MatOfByte matchesMask)</code></p>
<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; 4.0.0</li>
<li>Operating System / Platform =&gt; nixpkgs on macOS 10.14 (Mojave)</li>
<li>Compiler =&gt; clang</li>
</ul>
<h5 dir="auto">Detailed description</h5>

<p dir="auto">I'm packaging OpenCV-4.0.0 in nixpkgs at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384082666" data-permission-text="Title is private" data-url="https://github.com/NixOS/nixpkgs/issues/51027" data-hovercard-type="pull_request" data-hovercard-url="/NixOS/nixpkgs/pull/51027/hovercard" href="https://github.com/NixOS/nixpkgs/pull/51027">NixOS/nixpkgs#51027</a>.</p>
<p dir="auto">The build succeeds on the <code class="notranslate">aarch64-linux</code> and <code class="notranslate">x86_64-linux</code> platforms. Unfortunately it fails on <code class="notranslate">x86_64-darwin</code> while linking the <code class="notranslate">videoio</code> module. See the full build log <a href="https://logs.nix.ci/?key=nixos/nixpkgs.51027&amp;attempt_id=2f1211fc-1c0b-45fb-837f-f240cc720170" rel="nofollow">here</a>.</p>
<p dir="auto">So it looks like a linker issue:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ 62%] Linking CXX shared library ../../lib/libopencv_videoio.dylib
Undefined symbols for architecture x86_64:
  &quot;_OBJC_CLASS_$_NSData&quot;, referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
  &quot;_OBJC_CLASS_$_NSDate&quot;, referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
  &quot;_OBJC_CLASS_$_NSDictionary&quot;, referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
  &quot;_OBJC_CLASS_$_NSURL&quot;, referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:193: lib/libopencv_videoio.4.0.0.dylib] Error 1"><pre class="notranslate"><code class="notranslate">[ 62%] Linking CXX shared library ../../lib/libopencv_videoio.dylib
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_NSData", referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
  "_OBJC_CLASS_$_NSDate", referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
  "_OBJC_CLASS_$_NSDictionary", referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
  "_OBJC_CLASS_$_NSURL", referenced from:
      objc-class-ref in cap_avfoundation_mac.mm.o
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:193: lib/libopencv_videoio.4.0.0.dylib] Error 1
</code></pre></div>
<p dir="auto">Apparently <a href="https://developer.apple.com/documentation/foundation/nsdata" rel="nofollow"><code class="notranslate">NSData</code> is part of the Foundation framework</a>. I don't see <code class="notranslate">-framework foundation</code> anywhere in the opencv sources so I tried adding it to the makefile of the failing videoio module <a href="https://github.com/opencv/opencv/blob/4.0.0/modules/videoio/CMakeLists.txt#L16">here</a>. Unfortunately that didn't help.</p>
<p dir="auto">Any idea what I'm doing wrong?</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">First <a href="https://nixos.org/nix/" rel="nofollow">install Nix</a> on OS X.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone git@github.com:NixOS/nixpkgs.git
cd nixpkgs

# Fetch my PR that adds OpenCV-4.0.0
git fetch origin pull/51027/head:opencv-4.0.0
git checkout opencv-4.0.0

# Try building OpenCV-4.0.0
nix-build -A opencv4"><pre class="notranslate"><code class="notranslate">git clone git@github.com:NixOS/nixpkgs.git
cd nixpkgs

# Fetch my PR that adds OpenCV-4.0.0
git fetch origin pull/51027/head:opencv-4.0.0
git checkout opencv-4.0.0

# Try building OpenCV-4.0.0
nix-build -A opencv4
</code></pre></div>