"Illegal instruction" 在 Raspberry Pi 上尝试 运行 交叉编译 Qt (Windows)

"Illegal instruction" when trying to run cross-compiled Qt on Raspberry Pi (Windows)

我已经找到并阅读了question here, also threads here and here,不幸的是它仍然没有解决。 (虽然我使用了该线程中的所有提示来提供尽可能多的信息)


有什么问题

几天来,我一直在努力寻找一种能够交叉编译 Qt 的方法,因为我最近得到了一个,现在想学习如何编码一些基本的嵌入式应用程序。

我在这里学习教程: http://visualgdb.com/tutorials/raspberry/qt/embedded/

几个小时后,一切都构建好了,大概没有错误。 (我的输出与教程中的屏幕截图不太一样)

但是,尝试 运行 构建任何示例,结果只有一行: Illegal instruction


我还能提供什么...


在此先感谢您的帮助。当然,如果需要,我会提供任何必要的信息。

说真的,我试了一个星期,已经失败了 linux-like wiki.qt.io wiki.qt.io 不过,我真的很期待从 Windows :)

创建一个健壮的、交叉编译的、远程部署的 Qt 环境,以便将来在我的 Raspberry 上进行开发

好吧,事实证明这很明显。这里的教程:http://visualgdb.com/tutorials/raspberry/qt/embedded/是为Raspberry Pi 2制作的,虽然没有明确提到

幸运的是,您只需要将配置脚本从 -device linux-rasp-pi2-g++ 更改为 -device linux-rasp-pi-g++

我很惊讶,但显然它对我来说非常有效。

所以现在配置行应该如下所示:

../qt-everywhere-opensource-src-5.5.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -opengl es2 -device linux-rasp-pi-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -qt-xcb

感谢 @Bugfinger 的提示:)

PS。如果您不知道您拥有的是哪个版本的 RPi(我根本不确定),您可以比较规格和外围设备 here or here