Golang oci8:添加符号时出错:文件格式错误

huangapple go评论84阅读模式
英文:

Golang oci8: error adding symbols: File in wrong format

问题

我正在尝试使用Go语言中的这个包连接到Oracle数据库。我已经安装了Oracle 11.2和12.1的服务器和instantclient,并且我正在按照关于oci8.pc文件的说明进行操作。我的操作系统是Windows。

然而,当我运行"go get github.com/mattn/go-oci8"(或在直接获取了包的源代码后尝试安装使用该包的程序)时,我遇到了以下错误:

# 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

有人知道问题是什么以及如何解决吗?

英文:

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?

答案1

得分: 2

看起来是我在尝试安装oci8时遇到的相同问题。你是否使用TDM_GCC?对我来说,问题是TDM_GCC存在编译器/链接器错误,无法编译某些文件。我改用ming64,然后问题解决了。你可以在这里查看我关于此问题的详细帖子:

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

英文:

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

huangapple
  • 本文由 发表于 2016年1月26日 07:58:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/35004744.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定