c++ - 如何在其他 linux 平台上部署带有所有 dll 文件的 Qt 应用程序?

标签 c++ linux qt packaging

我在 linux 操作系统中使用 Qt Creator 创建了一个网络浏览器。 我必须在另一个也有 linux 操作系统的系统上运行这个浏览器。 而且我不想在其他系统中安装 Qt Creator。 我希望我的浏览器应该独立运行。 使用 build 我创建了浏览器,但是当我运行 .exe 文件时,它显示找不到 .dll 文件。 所以,我想知道如何将我的应用程序与库绑定(bind)。 谢谢。

最佳答案

要创建 .deb 包,您可以根据需要调整我的方法。

/!\ You have to build your program with a kit compatible with qt5-default

创建一棵树,例如:

package_folder
|-DEBIAN
  |-control (a file)
  |-postinst (bash script)
|-opt
  |-your_binary (your app binary)
|-usr
  |-bin
  |-share
    |-application
      |-package_folder.desktop (to create a shortcut)

控制文件:

Package: regexp-testor
Version: 1.0
Section: devel
Priority: optional
Architecture: amd64
Depends: qt5-default
Maintainer: thibsc <mail@mail.com>
Homepage: https://github.com/thibsc
Description: RegExp testor
 RegExp testor is a regular expression testor like the rubular.com website.

postinst 脚本:

#!/bin/bash
echo "Create a symbolic link towards the binary"
sudo ln -s /opt/regexp_testor/regexp_testor /usr/bin
echo "Enjoy ;)"

package_folder.desktop 文件:

[Desktop Entry]
Version=1.0
Type=Application
Name=RegExp testor
GenericName=RegExp testor
Comment=A regular expression testor like the rubular.com website
Exec=/opt/regexp_testor/regexp_testor
Terminal=false
MimeType=text/plain;
Icon=regexp_testor_icon
Categories=Development;
StartupNotify=true

然后将您置于您的 package_folder 级别并运行 sudo dpkg-deb --build package_folder,您应该有一个可以使用的 .deb 包。

编辑:
您也可以使用 debpac生成您的数据包。

关于c++ - 如何在其他 linux 平台上部署带有所有 dll 文件的 Qt 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43518705/

相关文章:

python - 未调用 PyQt 窗口焦点事件

C++ 输入运算符重载 >>

linux - 限制 Linux 上调试应用程序的资源使用

c - 检测systemd的可靠方法

c++ - 如何使用 Qt 从磁盘读取 XML 文件?

css - 使用 CSS 设计 QTabWidget 背景

c++ - 如何在 QML 应用程序中安装和使用用 Qt C++ 编写的事件过滤器

c++ - 如何为长字符串分配指针成员?

c++ - 使用结构成员创建映射会抛出 bad_alloc

linux - 使用 sed 或 awk 重复提取两个字符串之间的文本?