Lex
Lex

Reputation: 5014

Nim cannot open 'opencv/highgui'

I'm trying to use this library https://github.com/dom96/nim-opencv a wrapper for OpenCV.

After running nimble install opencv I can see the package in ~/.nimble/pkgs/opencv-0.1.0/

But when attempting to use I get a compile error

Error: cannot open 'opencv/highgui'

import opencv/highgui
const fileName = "g.jpg"
let img_colr = loadImage(fileName, 1)
echo img_colr.width
echo img_colr.height

Not sure what the problem is something to do with Nim import paths?...

Upvotes: 3

Views: 667

Answers (1)

dom96
dom96

Reputation: 1022

Are you compiling with nimble or nim? If the former then make sure you've got requires "opencv" in your .nimble file.

Upvotes: 2

Related Questions