[libvirt-users] Golang libvirt bindings problem

Daniel P. Berrangé berrange at redhat.com
Wed Jan 9 10:04:03 UTC 2019

On Thu, Jan 03, 2019 at 01:37:51AM +0000, Branimir Pejakovic wrote:
> Hello everybody!
> First, allow me to wish you all a Happy New year!
> I have a problem with a small app that I wrote in Go and which uses libvirt
> go bindings. Actually, the problem exists only when I want to compile the
> code statically. Basically, when CGO_ENABLED=0 is exported, go (running go
> test, go run, go build) complains:
> undefined: libvirt.NewConnect

The libvirt bindings use CGo, so when you set CGO_ENABLED=0 you break
the bindings. You must not set that env variable.

|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

More information about the libvirt-users mailing list