本文介绍了QtCreator的交叉编译错误[Yocto Image]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Beaglebone Black制作了一个qt5图片,并导出了跨工具链sdk。
我还尝试通过以下

I've bitbaked a qt5 image for my Beaglebone Black and exported the cross-toolchain sdk.I also tried to setup QtCreator to work with the output toolchain with the steps in this link

我将此代码放在qtcreator.sh文件的开头以更改环境变量

I put this code at the beginning of the qtcreator.sh file to change the environment variables

并配置了以下选项


  • qmake
    / home / user / cross / sysroots / x86_64-pokysdk-linux / usr / bin / qt5 / qmake

  • g ++编译器
    / home / user / cross / sysroots / x86_64-pokysdk-linux / usr / bin / arm-poky-linux-gnueabi / arm-poky-linux-gnueabi-g ++

  • Sysroot :/ home / user / cross / sysroots / cortexa8hf-neon-poky-linux-gnueabi

  • qmake:/home/user/cross/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake
  • g++ compiler:/home/user/cross/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
  • Sysroot: /home/user/cross/sysroots/cortexa8hf-neon-poky-linux-gnueabi

但是,当我构建时该项目我得到以下错误:

However, when I build the project I get the following errors :


错误:找不到-lQt5Widgets
错误:找不到-lQt5Core
错误:找不到-lQt5Gui
错误:collect2:错误:ld返回1退出状态

有人对此有解决方案吗?

Does anybody have a solution for this?

PS 当我使用终端编译项目时,它编译时没有错误,并且在目标上运行良好。我的主机在Ubuntu 16.0上运行。

P.S. when I compile the project using terminal it compiles with no error and works well on the target. My host machine is running on Ubuntu 16.0.

推荐答案

在有人遇到相同问题的情况下,我找到了答案。

I found the answer to this in case somebody has the same issue.

解决方案是在您在QtCreator中创建的工具包的 Qt mkspec中添加 linux-oe-g ++

the solution is to add linux-oe-g++ in the "Qt mkspec" of the kit you created in the QtCreator.

这篇关于QtCreator的交叉编译错误[Yocto Image]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 08:36