gocv icon indicating copy to clipboard operation
gocv copied to clipboard

Try to cross-compile from linux to windows ends with fatal error

Open hrueschwein opened this issue 2 years ago • 0 comments

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

  1. Write code, which imports gocv
  2. 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 or env.cmd script before trying to go run or go build? No

hrueschwein avatar May 02 '22 09:05 hrueschwein