[英]Create Executable from Linux using Qt 5, C++ and OpenCV
I've been trying to deploy an executable version of my program, I tried in many ways as我一直在尝试部署我的程序的可执行版本,我尝试了很多方式
but those hasn't worked for me, I can deploy the program in the development enviroment, but I need to install it in different computers.但那些对我不起作用,我可以在开发环境中部署程序,但我需要将它安装在不同的计算机上。 If if's possible to create the version for Windows (Because the university I developed it for is asking for it)如果可以为 Windows 创建版本(因为我开发它的大学要求它)
I'm using Qt 5.9.5, gcc 7.5.0, CMake 3.10.2, GDB 8.1.0, OpenCV 4.1.1 and SO Linux Mint 19.1 Tessa. I'm using Qt 5.9.5, gcc 7.5.0, CMake 3.10.2, GDB 8.1.0, OpenCV 4.1.1 and SO Linux Mint 19.1 Tessa.
I would suggest you to try using CQtDeployer from https://github.com/QuasarApp/CQtDeployer我建议您尝试使用来自https://github.com/QuasarApp/CQtDeployer的 CQtDeployer
You can find instalation guide in this video , even though it isn't in english language, everything is described step by step in there.您可以在此视频中找到安装指南,即使它不是英文的,但其中的所有内容都是逐步描述的。
Hope that would work for you.希望这对你有用。
How to deploy project with cqtdeployer.如何使用 cqtdeployer 部署项目。
First one you need to install cqtdeployer into your platform第一个您需要将 cqtdeployer 安装到您的平台中
sudo snap install cqtdeployer
Or或者
Install from snap store and add all requirement permissions.从快照商店安装并添加所有要求权限。
chmod +x LinuxInstaller.run./LinuxInstaller.run
Build your project on release mode.在发布模式下构建您的项目。
Deploy yor executable file.部署你的可执行文件。
cqtdeployer -bin myexecutable
cqtdeployer -bin myexecutable.exe -qmake C:/Qt/5.15.0/min_gw/bin/qmake.exe
cqtdeployer -bin myexecutable.exe -qmake ~/crossbuildet-Qt/5.15.0/min_gw/bin/qmake
If you use extra libraries.如果您使用额外的库。 just add path for cqtdeployer to used libs.只需将 cqtdeployer 的路径添加到使用的库中。
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs
If you want find libraryes recursive from libDir path, just add recursiveDepth option.如果您想从 libDir 路径中找到递归库,只需添加 recursiveDepth 选项。
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5
If you application use qml, just add qmlDir option如果您的应用程序使用 qml,只需添加 qmlDir 选项
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources
If you want create simple installer for you application just add qif option.如果您想为您的应用程序创建简单的安装程序,只需添加 qif 选项。
cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources qif
If you use system libraries from system PATH, just add deploySystem option.如果您使用系统 PATH 中的系统库,只需添加 deploySystem 选项。
Warning: snap version do not have permision to system files. 警告:快照版本没有系统文件的权限。 To deploy system libraries use the cqtdeployer version from the installer 要部署系统库,请使用安装程序中的 cqtdeployer 版本cqtdeployer -bin myexecutable -libDir /PathToMyExtraLibs -recursiveDepth 5 -qmlDir /path/to/my/qml/sources qif deploySystem
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.