用QT4开发程序的打包问题?
Tofloor
poster avatar
hongkunjiang
deepin
2017-06-02 20:03
Author
请问在deepin下用QT4开发程序后如何打包?

之前用dkpg打包,安装后程序能正常运行,但是系统重启后,无法加载桌面,只有一个空空的背景。

求解决方法,打包方法。

谢谢!
Reply Favorite View the author
All Replies
avatar
HualetWang
deepin
2017-06-02 20:30
#1
看看你的安装包都装了什么文件? 另外,在终端启动一下 dde-desktop看看会输出什么
Reply View the author
avatar
hongkunjiang
deepin
2017-06-02 21:21
#2
MyApp.Desktop:
[Desktop Entry]
Version=0.1   
Name=MyApp
Comment=My software  
Exec=/usr/bin/MyApp                     
StartupNotify=true                        
Terminal=false                           
Type=Application                        
Categories=Application;           
Hidden=false                              
Icon=/usr/share/pixmaps/MyApp.png                           
Name=MyApp

control:
Package:  MyApp
Version: 1
Section: free
Priority: optional
Architecture: amd64
Maintainer: Simon <>
Description: The

postinst:
echo "Start to install"
mv  /application/lib/MyApp.desktop /usr/share/applications/
mv  /application/lib/MyApp.png /usr/share/pixmaps/
mv  /application/MyApp/MyApp /usr/bin/
mv  /application/MyApp/libpcap.so.1 /usr/local/lib/
mv  /application/MyApp/* /usr/lib/
mv  /qt/* /usr/lib/x86_64-linux-gnu/


mkdir /usr/bin/platforms/
mv  /platforms/* /usr/bin/platforms/

cat >> /etc/ld.so.conf < /usr/local/lib/
EOF
ldconfig

echo "set QT_PLUGIN_PATH in file .profile"
echo "QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins" >> ~/.profile
echo "Install ok"

安装后,软件能运行。
点下部,关机,进入新界面时,背景变得灰白(透明?)了,但是关机,重启等按钮可用。

重启,输入密码界面,背景也是灰白(透明?)的,但是也能正常输入登录。
进入桌面时,只有一个彩色的桌面,其他什么都没有了,时不时停在了某个位置?

“de-desktop看看会输出什么“
什么时候启动?安装前?安装后?重启后?重启后我没有机会启动啊

感谢您,愿深度越来越好!
Reply View the author
avatar
hongkunjiang
deepin
2017-06-02 21:22
#3
https://bbs.deepin.org/post/140417
看看你的安装包都装了什么文件? 另外,在终端启动一下 dde-desktop看看会输出什么 ...

我是在网上搜的教程,按步骤来的https://segmentfault.com/a/1190000005029385
Reply View the author
avatar
hongkunjiang
deepin
2017-06-02 21:37
#4
https://bbs.deepin.org/post/140417
看看你的安装包都装了什么文件? 另外,在终端启动一下 dde-desktop看看会输出什么 ...

安装后执行dde-desktop
lys@lys-PC:~$ dde-desktop
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.
已放弃

但是程序能正常执行
Reply View the author
avatar
hongkunjiang
deepin
2017-06-02 21:39
#5
不好意思,更正下,我用的是QT5.8
Reply View the author
avatar
HualetWang
deepin
2017-06-02 22:50
#6
ldd /usr/bin/dde-desktop 看看,感觉是链接到错误的Qt库上了;
Reply View the author
avatar
hongkunjiang
deepin
2017-06-02 23:25
#7
https://bbs.deepin.org/post/140417
ldd /usr/bin/dde-desktop 看看,感觉是链接到错误的Qt库上了;

我刚刚又做了测试
我适用的是15.4的桌面版DEEPIN,里面内置QT是5.6.1?

我只要把libqt5core.so.5.8.0等8个5.8的库拷贝到 /usr/lib/x86_64-linux-gnu/目录下,就有问题。
如果不拷贝这几个QT库,系统就没问题,但是不拷贝,程序也没办法运行……
Reply View the author
avatar
HualetWang
deepin
2017-06-05 17:07
#8
你用仓库里面的Qt编译你的应用就好了……

sudo apt-get update; sudo apt-get install qt5-qmake qt5-default build-essential,

qtcreator是 sudo apt-get install qtcreator
Reply View the author