gocv
gocv copied to clipboard
undefined: CalibFlag and others at WSL
I installed gocv at Windows 10 WSL, using Ubuntu. installation completed successfully, but once I tried to cross compile for Windows, I got the below :
# gocv.io/x/gocv
/home/hajsf/Go/src/gocv.io/x/gocv/calib3d_string.go:3:9: undefined: CalibFlag
/home/hajsf/Go/src/gocv.io/x/gocv/calib3d_string.go:29:9: undefined: CalibCBFlag
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:3:9: undefined: MatType
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:57:9: undefined: CompareType
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:75:9: undefined: CovarFlags
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:93:9: undefined: DftFlags
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:113:9: undefined: RotateFlag
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:125:9: undefined: KMeansFlags
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:137:9: undefined: NormType
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:159:9: undefined: TermCriteriaType
/home/hajsf/Go/src/gocv.io/x/gocv/core_string.go:159:9: too many errors
Your Environment
- Operating System and version: WSL at Windows 10 - Ubuntu WSL 2
- OpenCV version used: 4.4.0
- How did you install OpenCV? as per GOCV instructions https://gocv.io/getting-started/linux/
- GoCV version used: 0.24.0
- Go version: 1.15
- Did you run the
env.sh
orenv.cmd
script before trying togo run
orgo build
? No
Hi @hajsf,
I had the same issue. Did you check if the env CGO_ENABLED=1?
Regards Gianni
@giovanni-annunzio you are a hero,
@giovanni-annunzio Hi! 👋
I'm having the same error, but in MSYS2 on Windows 11. just wonder if you have any ideas =P
phili@PhilBook3 UCRT64 ~/gocv
$ set CGO_ENABLED=1
phili@PhilBook3 UCRT64 ~/gocv
$ go run -tags customenv "C:\msys64\ucrt64\lib\go\pkg\mod\gocv.io\x\[email protected]\cmd\version\main.go"
# gocv.io/x/gocv
C:\Users\phili\go\pkg\mod\gocv.io\x\[email protected]\calib3d_string.go:3:9: undefined: CalibFlag
C:\Users\phili\go\pkg\mod\gocv.io\x\[email protected]\calib3d_string.go:29:9: undefined: CalibCBFlag
C:\Users\phili\go\pkg\mod\gocv.io\x\[email protected]\core_string.go:3:9: undefined: MatType
...
C:\Users\phili\go\pkg\mod\gocv.io\x\[email protected]\core_string.go:159:9: too many errors