ora=<instaclient-install-dir>
gcc=<tdm-gcc-install-dir>
oralib=${ora}\\sdk\\lib\\msvc
orainclude=${ora}\\sdk\\include
gcclib=${gcc}\\lib
gccinclude=${gcc}\\include
Name: OCI
Description: Oracle database engine
Version: 12.1
Libs: -L${oralib} -L${gcclib} -loci
Libs.private:
Cflags: -I${orainclude} -I${gccinclude}
Make sure to use \\
as the path separator
set PATH=<tdm-gcc-install-dir>\bin;%PATH%
set PKG_CONFIG_PATH=<path-to->\oci8.pc
go get github.com/mattn/go-oci8
go build -x your-prog.go
Note: -x
will show you the underlying gcc/ld commands, which is incredibly useful for debugging
Dear @mnadel, do you have some example on how to use go-oci8 on OSX environment?
I tried to connect using
sqlplus scott/tiger@SHGU
and it's working fine.But whenever I try to run
_example/oracle.go
from go-oci8, it always ended up "ORA-12545: Connect failed because target host or object does not exist".I already set the variables.
could you advise me how to solve this?