英文:
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论