Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?...

like image 382
Lex Avatar asked Mar 17 '26 18:03

Lex


1 Answers

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

like image 108
dom96 Avatar answered Mar 21 '26 17:03

dom96



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!