简体   繁体   English

Qt-无法使用外部库进行交叉编译

[英]Qt - Cannot use external library for cross compiling

I follow this document Cross Compile Qt - Raspberry , and it works completly. 我遵循此文档Cross Compile Qt-Raspberry ,它可以完全工作。 I can cross compile simple application from qt creator. 我可以交叉编译来自Qt Creator的简单应用程序。 Now i want to use external libary ( ID3lib ). 现在,我想使用外部库( ID3lib )。 But it gets error when build project 但是在构建项目时会出错

/home/shymaxtic/Documents/FPT/Hihi/ID3tag/lib/libid3.so: error: error adding symbols: File format not recognized. /home/shymaxtic/Documents/FPT/Hihi/ID3tag/lib/libid3.so:错误:添加符号错误:无法识别文件格式。

Can anyone help me? 谁能帮我?

Like Kuba Ober pointed, in order to include on you board a external library, you need to cross compile it, just like you do for your application. 就像库巴·奥伯(Kuba Ober)指出的那样,为了在您的计算机上包含一个外部库,您需要对其进行交叉编译,就像您对应用程序所做的那样。

Depending on the size of the library, you can either integrate it in your Qt project by creating a top level SUBDIR project, or simply cross-compile it manually, and provide the path to the cross-compiled library like you did here with LIBS += -L<path> -l<library> 根据库的大小,您可以通过创建顶级SUBDIR项目将其集成到Qt项目中,也可以手动对其进行交叉编译,然后像使用LIBS += -L<path> -l<library>一样在此处提供交叉编译库的路径。 LIBS += -L<path> -l<library>

When cross compiling, make sure to use the toolchain specific for your board (you already have it for Qt), and not the gcc/g++ of your desktop distribution 交叉编译时,请确保使用特定于您的电路板的工具链(您已经在Qt中使用了它),而不要使用桌面发行版的gcc / g ++

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

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