Tuy
Tuy

Reputation: 33

Golang oci8: error adding symbols: File in wrong format

I am trying to connect to an Oracle database in Go using this package. I have both server and instantclient installed for both Oracle 11.2 and 12.1, and I'm following the instructions regarding the oci8.pc file. My operating system is Windows.

However, when I run "go get github.com/mattn/go-oci8" (or attempt to install a program that uses the package after having gotten the package's source code directly) I get this error:

# github.com/mattn/go-oci8
C:/oraclexe/app/oracle/product/11.2.0/server/oci/lib/MSVC/oci.lib: error adding symbols: File in wrong format
collect2.exe: error: ld returned 1 exit status

Does anyone know what the problem is and how to fix it?

Upvotes: 1

Views: 1786

Answers (1)

Osman Qamar
Osman Qamar

Reputation: 21

Looks to be the same issue I had trying to install oci8. Are you using TDM_GCC? The problem for me was that TDM_GCC has a compiler / linker bug that prevents from compiling certain files. I used ming64 instead and it worked. You can see my detailed posts regarding that here:

https://github.com/mattn/go-oci8/issues/75

Upvotes: 2

Related Questions