rana / ora

An Oracle database driver in Go.
MIT License
272 stars 66 forks source link

how to add "=lnnz11" to the list of linked libs #242

Closed jusongchen closed 6 years ago

jusongchen commented 6 years ago

Can anyone tell exectly what I need to do to add "=lnnz11" to the list of linked libs? This is what it says on this project's README.md :

WARNING: If you have Oracle Instant Client 11.2, you'll need to add "=lnnz11" to the list of linked libs! Otherwise, you may encounter "undefined reference to `nzosSCSP_SetCertSelectionParams' " errors. Oracle Instant Client 12.1 does not need this.

Also, "=lnnz11" looks odd, should it be "-lnnz11"?

I am using Oracle Instance Client 11.2, and I got:

$ go build -a
# gopkg.in/rana/ora.v4
/opt/oracle/instantclient_11_1/libnnz11.so: undefined reference to `nzdacvalue'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `AM_SHA256'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzstrcpy'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `AI_SHA256'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzcsf_AddtoCredStore'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `AI_SHA384'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzosSCSP_SetCertSelectionParams'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzstrlen'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzu_exit_trace'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `AI_SHA512'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzu_init_trace'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `AM_SHA384'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `nzu_print_trace'
/opt/oracle/instantclient_11_2/libclntsh.so: undefined reference to `AM_SHA512'
collect2: error: ld returned 1 exit status
tgulacsi commented 6 years ago

yes. -lnnz11 (libnnz11.so).

$ find /usr/lib/oracle
/usr/lib/oracle
/usr/lib/oracle/12.1
/usr/lib/oracle/12.1/client64
/usr/lib/oracle/12.1/client64/bin
/usr/lib/oracle/12.1/client64/bin/adrci
/usr/lib/oracle/12.1/client64/bin/genezi
/usr/lib/oracle/12.1/client64/lib
/usr/lib/oracle/12.1/client64/lib/ottclasses.zip
/usr/lib/oracle/12.1/client64/lib/libclntsh.so
/usr/lib/oracle/12.1/client64/lib/libclntshcore.so
/usr/lib/oracle/12.1/client64/lib/libocci.so
/usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1
/usr/lib/oracle/12.1/client64/lib/libclntshcore.so.12.1
/usr/lib/oracle/12.1/client64/lib/libipc1.so
/usr/lib/oracle/12.1/client64/lib/libmql1.so
/usr/lib/oracle/12.1/client64/lib/libnnz12.so
/usr/lib/oracle/12.1/client64/lib/libocci.so.12.1
/usr/lib/oracle/12.1/client64/lib/libociicus.so
/usr/lib/oracle/12.1/client64/lib/libocijdbc12.so
/usr/lib/oracle/12.1/client64/lib/libons.so
/usr/lib/oracle/12.1/client64/lib/liboramysql12.so
/usr/lib/oracle/12.1/client64/lib/ojdbc6.jar
/usr/lib/oracle/12.1/client64/lib/ojdbc7.jar
/usr/lib/oracle/12.1/client64/lib/xstreams.jar