Reputation: 429
I would like to use a go module named "go-yara" on Windows, which I cross-compiled on a Debian based Linux system. Everything works as expected. The build creates a go-yara.a
file in the $GOPATH/pkg/windows_386/github.com/hillu/
folder.
However when I try to use the module in a go program it seem that it tries to recompile the module from the src stating that a yara.h
file is missing. Yes, that's correct. There is no yara.h on Windows. It's much easier for me to compile yara and its headers on Linux.
This file is indeed needed during during cross-compilation on Linux. Why do I need it on Windows too? Isn't the go-yara.a
in the pkg folder enough? Why does it ignore the .a file and tries to compile the module from its source? Can I force it to use the precompiled module in the pkg
folder?
I am new to Golang so please excuse my ignorance.
Upvotes: 0
Views: 139
Reputation: 1088
According to the go-yara instructions you need to compile both on the Debian machine. The Go compilation instructions on go-yara shows it is cross compiling on the debian machine for windows 386. So you would run both on your Debian build machine and then copy over the windows binary to run the application.
Upvotes: 3