3d0c / imagio

Image Processing Web Service.
MIT License
90 stars 12 forks source link

Trouble with shared library of libopencv v2.3.1-7 #4

Open sigmonsays opened 10 years ago

sigmonsays commented 10 years ago

What version of go and libopencv should I be using?

Thanks!

 $ go install .
# github.com/3d0c/imagio/imgproc
./do.go:68: cannot use (*C.Blob)(unsafe.Pointer(blobptr(o.Base))) (type *C.Blob) as type *C.struct___0 in argument to _Cfunc_resizer
./do.go:69: cannot use (*C.PixelDim)(unsafe.Pointer(zoom)) (type *C.PixelDim) as type *C.struct___1 in argument to _Cfunc_resizer
./do.go:71: cannot use (*C.CvRect)(initCvRect(roi)) (type *C.CvRect) as type *C.struct_CvRect in argument to _Cfunc_resizer
./do.go:104: cannot use (*C.Blob)(blobptr(base)) (type *C.Blob) as type *C.struct___0 in argument to _Cfunc_blender
./do.go:105: cannot use (*C.Blob)(blobptr(o.Foreground)) (type *C.Blob) as type *C.struct___0 in argument to _Cfunc_blender
./do.go:106: cannot use (*C.Blob)(blobptr(o.Mask)) (type *C.Blob) as type *C.struct___0 in argument to _Cfunc_blender
./do.go:108: cannot use (*C.CvRect)(rect) (type *C.CvRect) as type *C.struct_CvRect in argument to _Cfunc_blender
sigmonsays commented 10 years ago

I want to add the build works fine with go1.1.2 but breaks with go1.3. I suspect its related to how cgo handles pointers to incomplete types. See https://golang.org/doc/go1.3#cgo for more details. I'll try to figure out the fix if I find the time.

3d0c commented 10 years ago

Fixed by a82dea416d15ba237c59107a65ad973a6cac3da9