Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I connect to Oracle database?

I am using Fedora 23 and installed Oracle 12.1 and Go 1.7.1

When I run:

go get github.com/mattn/go-oci8

I am getting an error:

/usr/bin/ld: skipping incompatible /usr/lib/oracle/12.1/client64/lib/libclntsh.so when searching for -lclntsh

/usr/bin/ld: cannot find -lclntsh

collect2: error: execution of ld completed with return code 1

like image 982
Андрей Астафьев Avatar asked Nov 16 '25 16:11

Андрей Астафьев


1 Answers

What did you put in your oci8.pc file?

I've just got this working with the below. Keeping in mind I have only the oracle 11.2 instant client installed under the prefix path. I assume you would have to change the version number to the appropriate number.

prefix=/home/sbr/wk/apps/oracle/product/11.2.0/client_1
exec_prefix=${prefix}
libdir=${prefix}
includedir=${prefix}/sdk/include

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: 11.2
like image 146
sbr Avatar answered Nov 19 '25 09:11

sbr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!