Skip to content

Instantly share code, notes, and snippets.

@Herts
Created August 15, 2019 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Herts/1568d1757851e623d7f2dcb765da12c4 to your computer and use it in GitHub Desktop.
Save Herts/1568d1757851e623d7f2dcb765da12c4 to your computer and use it in GitHub Desktop.
Install go-oci8 on 64-bit Windows

Here's my configuration for how to install go-oci8 on a 64-bit Windows.

  1. Download and install 64-bit gcc compiler: http://tdm-gcc.tdragon.net/

  2. 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

  1. Download and install pkg-config: https://stackoverflow.com/questions/1710922/how-to-install-pkg-config-in-windows

  2. 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

  1. Execute go get github.com/mattn/go-oci8 in cmd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment