Here's my configuration for how to install go-oci8 on a 64-bit Windows.
-
Download and install 64-bit gcc compiler: http://tdm-gcc.tdragon.net/
-
Download Oracle Instant Client and SDK: https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html
- Basic Package
- SDK Package
and unzip in a directory without spaces like C:\Oracle\instantclient_19_3
-
Download and install pkg-config: https://stackoverflow.com/questions/1710922/how-to-install-pkg-config-in-windows
-
Create a file named "oci8.pc", and store it somewhere like C:\Oracle\instantclient_19_3\pkg-config
Add these content to this file:
prefix=C:/Oracle/instantclient_19_3/sdk/
version=19.1
build=client64
libdir=C:/Oracle/instantclient_19_3/
includedir=C:/Oracle/instantclient_19_3/sdk/include
glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums
Name: oci8
Description: Oracle database engine
Version: ${version}
Libs: -L${libdir} -loci
Libs.private:
Cflags: -I${includedir}
And add this directory to environment variable PKG_CONFIG_PATH.
If you don't want to add it, you can just add it locally before next step in the same cmd: set PKG_CONFIG_PATH=C:\Oracle\instantclient_19_3\pkg-config
- Execute
go get github.com/mattn/go-oci8
in cmd.