[Nix-dev] How to build a Haskell binding to a C++ library (OpenCV) on OS X

Bas van Dijk v.dijk.bas at gmail.com
Sun Jun 18 21:47:14 CEST 2017


Good evening,

I'm trying to build our Haskell binding to the OpenCV C++ library on OS X.
The following commands should do the job:

  git clone https://github.com/LumiGuide/haskell-opencv.git
  cd opencv
  nix-build

Unfortunately it fails during the configure phase with:

  Setup: Cannot find the program 'gcc'.
  User-specified path 'g++' does not refer
  to an executable and the program is not on the system path.

If I add gcc to the build dependencies of opencv/opencv.nix using:

  buildDepends = [ gcc ];

and invoke nix-build again I get a different error:

  Setup: Missing dependencies on foreign libraries:
  * Missing C libraries: stdc++, opencv_stitching, opencv_superres,
  opencv_videostab, opencv_aruco, opencv_bgsegm, opencv_bioinspired,
  opencv_ccalib, opencv_dpm, opencv_freetype, opencv_fuzzy,
  opencv_line_descriptor, opencv_optflow, opencv_reg, opencv_saliency,
  opencv_stereo, opencv_structured_light,
opencv_phase_unwrapping, opencv_rgbd,
  opencv_surface_matching, opencv_tracking, opencv_datasets, opencv_text,
  opencv_face, opencv_plot, opencv_dnn, opencv_xfeatures2d, opencv_shape,
  opencv_video, opencv_ximgproc, opencv_calib3d, opencv_features2d,
  opencv_flann, opencv_xobjdetect, opencv_objdetect, opencv_ml,
opencv_xphoto,
  opencv_highgui, opencv_videoio, opencv_imgcodecs, opencv_photo,
  opencv_imgproc, opencv_core
  This problem can usually be solved by installing the system packages that
  provide these libraries (you may need the "-dev" versions). If the
libraries
  are already installed but in a non-standard location then you can use the
  flags --extra-include-dirs= and --extra-lib-dirs= to specify where they
are.

Any ideas how to get this working?

Regards,

Bas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170618/35c74374/attachment-0001.html>


More information about the nix-dev mailing list