日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

illegal instruction错误

發(fā)布時間:2025/4/16 编程问答 110 豆豆
生活随笔 收集整理的這篇文章主要介紹了 illegal instruction错误 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

原文地址:http://www.kuche361.com/ht/view/id-39165

?

?

這是個臭名昭著的問題,試了很多方法,也沒有解決。

7月15日~16日加起來搞了一天,把4.6.3重新編譯了兩次,還是沒有解決,而且還證明用mini6410提供的4.5.1版本的gcc,能夠編譯成功,但是QT4.6.3下載到開發(fā)板運行Demo程序,提示錯誤,不兼容,郁悶啊,因此一定要用4.4.3版本的gcc。

其中,網(wǎng)上有一篇英文寫的很好的文章,編譯前修改了QT源碼目錄內(nèi)兩個.conf文件,尤其是后面紅字部分特別提到了avoid some illegal instruction,以為可以類似解決:

Qt 4.6.2 installation procedure for FriendlyARM mini 2440 Linux

2011年03月21日 星期一 18:51

Qt 4.6.2 installation procedure for FriendlyARM mini 2440 Linux

Submitted by paolo on Sun 07/25/2010 - 03:44

This tutorial will provide a simple list of steps necessary to compile and install Qt 4.6.2 on Mini 2440 friendly ARM board. Italian speaking people can read this tutorial on Qt-Italia community website.

The board is equipped with the default GNU/Linux operating system (kernel 2.6.29)

This guide has been tested on following GNU/Linux host distributions:

CentOS 5.4

Fedora 12

Ubuntu 9.10

Some problems were found on following host distributions:

Ubuntu 9.04

OpenSUSE 11.2

First of all you have to download the GCC toolchain provided by the supplier:

Now untar the tgz file:

tar -xzf arm-linux-gcc-4.3.2.tgz

and then copy the directory tree under

/usr/local/

Remember to export this path on your shell

export PATH=/usr/local/arm/4.3.2/bin:$PATH

Now we can download Qt

and untar and unzip the file on a local directory (example: /home/user)

Now before running the configure tool you have to modify the qmake.conf file to inform Qt about your toolchain as described here:

File: mkspecs/qws/linux-arm-g++/qmake.conf

Now change following lines:

#QMAKE_CC = arm-linux-gcc

#QMAKE_CXX = arm-linux-g++

#QMAKE_LINK = arm-linux-g++

#QMAKE_LINK_SHLIB = arm-linux-g++

with:

QMAKE_CC = arm-none-linux-gnueabi-gcc

QMAKE_CXX = arm-none-linux-gnueabi-g++

QMAKE_LINK = arm-none-linux-gnueabi-g++

QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

Also change the following lines:

#QMAKE_AR = arm-linux-ar cqs

#QMAKE_OBJCOPY = arm-linux-objcopy

#QMAKE_STRIP = arm-linux-strip

with:

QMAKE_AR = arm-none-linux-gnueabi-ar cqs

QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy

QMAKE_RANLIB = arm-none-linux-gnueabi–ranlib

In order toavoid some illegal instruction on your ARM compiled application binaries you have to deactivate compiler optimization:

File: /mkspecs/common/g++.conf

Change this line

QMAKE_CFLAGS_RELEASE += -O2

With:

QMAKE_CFLAGS_RELEASE += -O0

Now we are ready; in the Qt root subdirectory we run this command:

./configure -embedded arm -xplatform qws/linux-arm-g++ -prefix \

/usr/local/Qt -qt-mouse-tslib -little-endian -no-webkit -no-qt3support \

-no-cups -no-largefile -optimized-qmake -no-openssl -nomake tools

And then we can run the command

make

If everything is ok now we can do

make install

In order to run our ARM compiled applications we have to set following environment variables on the mini2440 board:

export TSLIB_TSEVENTTYPE=INPUT

export TSLIB_CONSOLEDEVICE=none

export TSLIB_FBDEVICE=/dev/fb0

export TSLIB_TSDEVICE=/usr/input/ts

export TSLIB_CALIBFILE=/usr/etc/pointercal

export TSLIB_CONFFILE=/usr/etc/ts.conf

export TSLIB_PLUGINDIR=/usr/lib/ts

export LD_LIBRARY_PATH=/usr/local/Qt/lib

export QTDIR=/usr/local/Qt

export QWS_MOUSE_PROTO=tslib:/usr/input/ts

export QWS_DISPLAY=LinuxFB:mmWidth=310:mmHeight=190

The Qt library binary (and fonts subdir) shall be placed on a user defined directory of the mini 2440m board and then it is necessary to set LD_LIBRARY_PATH to this directory.

Qt binary application must be run with –qws command line argument to inform Qt that we are working on a Linux embedded system.

Using the described procedure I was able to compile Qt qwt library and embedded widgets example.

YouTube Video demo: Embedded Widgets example

YouTube Video demo: Qwt examples

If you have questions you can leave a comment to this post or better you can post to this forum

Good Luck!

mini-2440-board

折騰半天,還是沒有用,沒有解決Illegal instruction錯誤問題。

總結(jié)

以上是生活随笔為你收集整理的illegal instruction错误的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。