我使用这个指南在这里输入链接描述文档来安装交叉编译器4.9.3和qt4.8.6。我安装了它们并检查了它们更正的版本。http://www.mediafire.com/file/g0afghia7rkqx05/arm-cortexa9-linux-gnueabihf-4.9.3-20160512.tar.xz
http://www.mediafire.com/file/d54dbygdadergl1/target-qte-4.8.6-to-hostpc.tgz
然后:
cd ~
mkdir helloqt
vi main.cpp然后我写到:
#include <QApplication>
#include <QPushButton>
int main(int argc, char **argv)
{
QApplication app (argc, argv);
QPushButton button ("Hello world !");
button.show();
return app.exec();
}并保存它
cd ~/helloqt
/usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake -project
/usr/local/Trolltech/QtEmbedded-4.8.6-arm/bin/qmake
make当我在ubuntu内核中运行这个程序时,我看到这个eeror:
root@NanoPC-T2:/# tftp 192.168.101.4
tftp> get helloqt
Received 11660 bytes in 0.4 seconds
tftp> quit
root@NanoPC-T2:/# chmod +x helloqt
root@NanoPC-T2:/# .setqt4env
-bash: .setqt4env: command not found
root@NanoPC-T2:/# . setqt4env
ctp = 1
root@NanoPC-T2:/# ./helloqt -qws &
[1] 1909
root@NanoPC-T2:/# ./helloqt -qws &
[2] 1910
[1] Segmentation fault ./helloqt -qws
root@NanoPC-T2:/# ./helloqt -qws
[2]+ Segmentation fault ./helloqt -qws
Segmentation fault
root@NanoPC-T2:/# ./helloqt -qws
Segmentation fault
root@NanoPC-T2:/# [2]+ Segmentation fault ./helloqt -qws
-bash: [2]+: command not found
root@NanoPC-T2:/# Segmentation fault
-bash: Segmentation: command not found
root@NanoPC-T2:/# file ./helloqt
./helloqt: ERROR: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3 error reading (Invalid argument)如何解决这个错误?
发布于 2017-05-27 05:34:58
这意味着你的文件二进制文件是损坏的。我这样做是为了纠正这个问题:
https://stackoverflow.com/questions/43777222
复制相似问题