go-oci8: go-oci8 /usr/bin/ld: cannot find -lclntsh

go get github.com/mattn/go-oci8 returns go-oci8 /usr/bin/ld: cannot find -lclntsh collect2: error: ld returned 1 exit status and my oci8.pc is `prefix=/devel/target/XXXXXXXXXXXXXXXXXXXXXXXXXX exec_prefix=${prefix} libdir=/usr/lib/oracle/12.2/client64/lib includedir=/usr/include/oracle/12.2/client64

glib_genmarshal=glib-genmarshal gobject_query=gobject-query glib_mkenums=glib-mkenums

Name: oci8 Description: oci8 library Libs: -L${libdir} -lclntsh Cflags: -I${includedir} Version: 12.2` and go version is go version go1.6.2 linux/amd64

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 29 (11 by maintainers)

Most upvoted comments

I don’t have enough time to answer for each your small questions.

Thanks about install issue, I’v made Dockerfile based on official golang image(debian:stretch). https://github.com/ynishi/goora

export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib sudo apt install libaio

libdir=/usr/lib/oracle/12.2/client64/lib includedir=/usr/include/oracle/12.2/client64

glib_genmarshal=glib-genmarshal gobject_query=gobject-query glib_mkenums=glib-mkenums

Name: oci8 Description: oci8 library Libs: -L${libdir} -lclntsh Cflags: -I${includedir} Version: 12.2

@vk1818 I somehow got this to work… I’ve probably spend at least a whole day trying to get this to work. I hope it helps someone else. I’m on Linux Mint 18.3

  1. download the rpms from the oracle instant client
  2. Use alien to convert them to dep
  3. install with dpkg
  4. export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
  5. create oci8.pc file at /usr/local/share/pkgconfig
  6. go get github.com/mattn/go-oci8