I found that my Go sqlite3 code no longer working any more.
For example, here is a simple Go sqlite3 code, go-sqlite3-test.go, that's been working fine for years. I don't know when it broke, but I'm currently using go1.9.2, and I think the go's version upgrade is the main contribution as I don't recall upgrading any of the dependent go packages of the above code. (UPDATE: confirmed from another machine that go1.8.3 + lastest github.com/mattn/go-sqlite3
works just fine. All three machines have sqlite3
and libsqlite3-0:amd64
installed).
In one machine, I got:
$ go run go-sqlite3-test.go
# github.com/mattn/go-sqlite3
In file included from /usr/include/errno.h:35:0,
from cgo-gcc-prolog:21:
/usr/include/x86_64-linux-gnu/bits/errno.h:24:26: fatal error: linux/errno.h: No such file or directory
# include <linux/errno.h>
^
In another machine, using the same go1.9.2, downloading the code into /tmp/go-sqlite3-test
, I got:
$ go run go-sqlite3-test.go
# pkg-config --cflags sqlite3
pkg-config: exec: "pkg-config": executable file not found in $PATH
Having installed pkg-config
, in turn I got:
$ go run go-sqlite3-test.go
# pkg-config --cflags sqlite3
Package sqlite3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sqlite3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sqlite3' found
pkg-config: exit status 1
$ sudo pkg-config --cflags sqlite3
Package sqlite3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sqlite3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sqlite3' found
$ go build
# pkg-config --cflags sqlite3
Package sqlite3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sqlite3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sqlite3' found
pkg-config: exit status 1
How to get my Go sqlite3 code working again, for both cases? Thx.