gocv
gocv copied to clipboard
Try to cross-compile from linux to windows ends with fatal error
Hello! Got the same error as in this issue about WSL when I was trying to compile application to .exe, I used this command:
CGO_ENABLED=1 CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc GOARCH=amd64 GOOS=windows go build .
Output
# gocv.io/x/gocv In file included from calib3d.cpp:1: calib3d.h:5:10: fatal error: opencv2/opencv.hpp: No such file or directory 5 | #include ‹opencv2/opencv.hpp› | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
Steps to Reproduce
- Write code, which imports gocv
- Try to compile it with GOOS=windows
Your Environment
- Operating System and version: Kubuntu 20.04 (x64)
- OpenCV version used: 4.5.5
- How did you install OpenCV? Cloned repo and did
make install
- GoCV version used: v0.30.0
- Go version: go1.18.1 linux/amd64
- Did you run the
env.sh
orenv.cmd
script before trying togo run
orgo build
? No