Hello,
I'm trying to cross-compile a simple app that uses the
github.com/mattn/go-sqlite3 package. I've followed the steps on
http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
to get Go cross compiled, and a simple hello-world program can be cross
compiled from OS X to Linux/amd64.
I've installed the github package via
go-linux-amd64 get
github.com/mattn/go-sqlite3
and my GOROOT contains the right archive file in the correct place.
Building my applications succeeds as well:
$ go-linux-amd64 build short.go
file short
$ file short
short: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically
linked, not stripped
$
But when I try to execute this binary on the linux system (centos 5.5,
fwiw), I get an error opening the database file:
sql: unknown driver "sqlite3" (forgotten import?)
It appears the $GOROOT/pkg/linux_amd64/
github.com/mattn/go-sqlite3.a was
not linked into the executable?
Thanks in advance for any help,
-Jan