与Ubuntu 14中的QtCreator [Yocto Image]交叉编译错误

时间:2017-05-25 17:30:02

标签: c++ linux qt cross-compiling

Qt Creator提供此库错误:

11:13:12: Running steps for project qtConsoleTest...
11:13:12: Starting: "/usr/bin/make" clean
rm -f main.o
rm -f *~ core *.core
11:13:12: The process "/usr/bin/make" exited normally.
11:13:12: Configuration unchanged, skipping qmake step.
11:13:12: Starting: "/usr/bin/make" 
g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_CORE_LIB -I../qtConsoleTest -I. -isystem /opt/fsl-imx-x11/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/qt5 -isystem /opt/fsl-imx-x11/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I/opt/fsl-imx-x11/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-g++ -o main.o ../qtConsoleTest/main.cpp
g++  -o qtConsoleTest main.o   -lQt5Core -lpthread 
/usr/bin/ld: cannot find -lQt5Core
collect2: error: ld returned 1 exit status
make: *** [qtConsoleTest] Error 1
11:13:13: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project qtConsoleTest (kit: ce3TunnelBoard)
When executing step "Make"
11:13:13: Elapsed time: 00:01.

基于这个Question,我认为我的问题是Qt版本下的QMAKE_SPEC和QMAKE_XSPEC应该显示linux-oe-g ++(而不是linux-g ++),但我不知道如何改变那。我错过了任何步骤吗?

我已经咬了Qt5 SDK,我也在" /opt/Qt5.8.0/Tools/QtCreator/bin/qtcreator.sh"中找到了这个环境。在顶部添加:

source /opt/fsl-imx-x11/4.1.15-2.0.1/environment-setup-cortexa7hf-neon-poky-linux-gnueabi

并在Debuggers,Compilers& amp; Qt版本分别为:

/opt/fsl-imx-x11/4.1.15-2.0.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb
/opt/fsl-imx-x11/4.1.15-2.0.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++
/opt/fsl-imx-x11/4.1.15-2.0.1/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake

以下是截图。

I'd appreciate任何帮助。

1 个答案:

答案 0 :(得分:1)

您的上一次屏幕截图显示标有 Qt mkspec 的文字条目。您应该在此处输入linux-oe-g++来覆盖linux-g++工具包的默认值c3TunnelBoard。有关如何设置QtCreator以与Yocto工具链一起使用的更多信息,请参阅this link