yulutong 发表于 2011-8-5 14:40:31

linux 脚本文件怎么写?helloworld在QT中运行要用到

设置的环境变量太多了。码字很辛苦;我把要填写的帖出来了,请版主帮我做个脚本文件。

export PATH='/opt/Qtopia4.4.3/bin:/sbin:/usr/sbin:/bin:/usr/bin'
export QPEDIR='/opt/Qtopia4.4.3'
export QTDIR='/opt/Qtopia4.4.3'
export QT_QWS_FONTDIR='/opt/Qtopia4.4.3/lib/fonts/'
export QWS_DISPLAY='LinuxFb:mmWidth76:mmHeight44:1'
export QWS_MOUSE_PROTO='Tslib:/dev/input/event1'
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/usr/local/etc/ts.conf'
export TSLIB_CONSOLEDEVICE='none'
export TSLIB_FBDEVICE='/dev/fb0'
export TSLIB_PLUGINDIR='/usr/local//tslib/lib/ts'
export TSLIB_ROOT='/usr/local/tlib'
export TSLIB_TSDEVICE='/dev/input/event1'
export TSLIB_TSEVENTTYPE='H3600'
export QT_PLUGIN_PATH='/opt/Qtopia4.4.3/plugins:/opt/Qtopia4.4.3/qt_plugins/'
export LD_LIBRARY_PATH='/opt/Qtopia4.4.3/lib'

yulutong 发表于 2011-8-5 16:16:49

我做的脚本文件会有错误提示
-/bin/sh: ./profile_h: not found

飞凌-fatfish 发表于 2011-8-5 16:53:36

#!/bin/sh
export PATH='/opt/Qtopia4.4.3/bin:/sbin:/usr/sbin:/bin:/usr/bin'
export QPEDIR='/opt/Qtopia4.4.3'
export QTDIR='/opt/Qtopia4.4.3'
export QT_QWS_FONTDIR='/opt/Qtopia4.4.3/lib/fonts/'
export QWS_DISPLAY='LinuxFb:mmWidth76:mmHeight44:1'
export QWS_MOUSE_PROTO='Tslib:/dev/input/event1'
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/usr/local/etc/ts.conf'
export TSLIB_CONSOLEDEVICE='none'
export TSLIB_FBDEVICE='/dev/fb0'
export TSLIB_PLUGINDIR='/usr/local//tslib/lib/ts'
export TSLIB_ROOT='/usr/local/tlib'
export TSLIB_TSDEVICE='/dev/input/event1'
export TSLIB_TSEVENTTYPE='H3600'
export QT_PLUGIN_PATH='/opt/Qtopia4.4.3/plugins:/opt/Qtopia4.4.3/qt_plugins/'
export LD_LIBRARY_PATH='/opt/Qtopia4.4.3/lib'

yulutong 发表于 2011-8-8 15:52:45

斑竹我的操作如下,你帮我看看有没有问题。
1在vmware里编写好脚本文件
2拷贝到SD卡中
3 在开发板中 #mkdir /tmp/sd
                   #mount /dev/sdcard/tmp/sd
                  #cd /tmp/sd
                  #ls
可以看到SD卡的内容
4   #chmod +x profile_h(脚本文件权限 可执行)
5./helloworld -qws
结果是报错
root@FORLINX6410]# ./helloworld -qws
./helloworld: error while loading shared libraries: libQtGui.so.4: cannot open

脚本文件可以放在/tmp下么?

yulutong 发表于 2011-8-8 15:54:14

我把校对过的脚本文件再上传下,可以的话你帮我试下。或者你把脚本文件给我共享下。谢了。
#!/bin/sh
export PATH='/opt/Qtopia4.4.3/bin:/sbin:/usr/sbin:/bin:/usr/bin'
export QPEDIR='/opt/Qtopia4.4.3'
export QTDIR='/opt/Qtopia4.4.3'
export QT_QWS_FONTDIR='/opt/Qtopia4.4.3/lib/fonts/'
export QWS_DISPLAY='LinuxFb:mmWidth76:mmHeight44:1'
export QWS_MOUSE_PROTO='Tslib:/dev/input/event1'
export TSLIB_CALIBFILE='/etc/pointercal'
export TSLIB_CONFFILE='/usr/local/tslib/etc/ts.conf'
export TSLIB_CONSOLEDEVICE='none'
export TSLIB_FBDEVICE='/dev/fb0'
export TSLIB_PLUGINDIR='/usr/local/tslib/lib/ts'
export TSLIB_ROOT='/usr/local/tslib'
export TSLIB_TSDEVICE='/dev/input/event1'
export TSLIB_TSEVENTTYPE='H3600'
export QT_PLUGIN_PATH='/opt/Qtopia4.4.3/plugins:/opt/Qtopia4.4.3/qt_plugins/'
export LD_LIBRARY_PATH='/opt/Qtopia4.4.3/lib'
echo "this is"

飞凌-fatfish 发表于 2011-8-8 17:12:12

./helloworld: error while loading shared libraries: libQtGui.so.4: cannot open

环境变量还是不对。
楼主的qmake是qt-extended-4.4.3编译的时候生成的么?

yulutong 发表于 2011-8-9 07:35:21

是qt-extended-4.4.3生成的。因为我把环境变量用手打一边的话,可以执行helloworld。
你有脚本文件吗?你们不会是每次都手打一边吧

dasenlin 发表于 2011-8-19 15:00:29

飞凌-fatfish 发表于 2011-8-19 17:02:16

已经在你其他帖子里回复了

2606133 发表于 2012-4-20 16:06:08

飞凌-develop 发表于 2012-4-21 08:58:02

楼上朋友可以修改我们提供的 /bin目录下面的 Qtopia4脚本,把最后一行修改为您的可执行程序,运行脚本即可运行您的应用,且可以使用触摸屏操作。
页: [1]
查看完整版本: linux 脚本文件怎么写?helloworld在QT中运行要用到