简体   繁体   English

MySQL C ++连接器:添加符号错误:无法识别文件格式

[英]MySQL C++ Connector : error adding symbols: File format not recognized

I have a problem on my cross-compile with Visual Studio Enterprise 2015 and my ARM under Debian 8 (BeagleBone Black). 我在使用Visual Studio Enterprise 2015和Debian 8(BeagleBone Black)下的ARM进行交叉编译时遇到问题。

All is working fine, the code compile, at least the linking of the objects. 一切正常,代码可以编译,至少是对象的链接。 I have a message like : 我有一条消息,如:

Project/lib/libmysqlcppconn-static.a: error adding symbols: File format not recognized
1>  collect2: error: ld returned 1 exit status

I have searched and it seems to be an architecture problem, most of the time. 我进行了搜索,大多数时候似乎是架构问题。 But I tried with a 32 bit version. 但是我尝试使用32位版本。

For information, I have compiled the same program in the same context, without the Connector/C++ lib, but with another library, static too, with the same extension (. a) too, and it worked fine. 作为参考,我在相同的上下文中编译了相同的程序,没有使用Connector / C ++ lib,但是使用了另一个静态库,也具有相同的扩展名(.a),并且运行良好。 I searched in MySQL Documentation, but nothing explicitly saying that ARM is not supported. 我在MySQL文档中进行了搜索,但没有明确指出不支持ARM。

Anyone has information on this? 有人对此有信息吗?

(PS: First post, and school english, hope it's not too bad !) (PS:第一篇文章和学校英语,希望还不错!)

I don't think you'll have much luck compiling for Linux using Visual Studio; 我认为使用Visual Studio进行Linux编译不会很幸运。 Microsoft tools use COFF object format and Linux uses ELF (and the libraries are totally different), so at the binary level they are really talking different languages even if you are compiling for the same CPU instruction set. Microsoft工具使用COFF对象格式,而Linux使用ELF(并且库完全不同),因此在二进制级别,即使您为相同的CPU指令集进行编译,它们实际上也使用不同的语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM