QT enVocabulary工程打包问题记录

网友投稿 848 2022-08-27

QT enVocabulary工程打包问题记录

QT enVocabulary工程打包问题记录

我用QT自带的工具*deployqt把工程enVocabulary在mac,windows,ubuntu上打包,出现了一些问题。 下面是一些bug记录。

SQlite Mysql的依赖问题。

WARNING: Plugin "libqsqlodbc.dylib" uses private API and is not Mac App store compliant.WARNING: Plugin "libqsqlpsql.dylib" uses private API and is not Mac App store compliant.ERROR: no file at "/opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib"ERROR: no file at "/usr/local/lib/libpq.5.dylib"

听说这是QT自身的bug,使用了SQlite则会需要用到Mysql的库文件,不用管。 直接macdeployqt走起。

QML程序打包问题

运行程序,窗体含有QML的部分是空白的。

module "QtQuick.Window" is not installedmodule "QtQuick.Controls" is not installedmodule "QtQuick" is not installed...

搜寻后,发现系统的​​QML路径是/Users/weiyang/Qt5.9.2/5.9.2/clang_64/qml​​​ 打包后已经有framework:​​​./enVocabulary.app/Contents/Frameworks/QtQuick.framework​​​ 那是怎么回事儿? 在文件夹中搜寻qml文件:

weiyangdeMacBook-Air:enVocabulary weiyang$ find enVocabulary.app/ -name *qmlweiyangdeMacBook-Air:enVocabulary weiyang$

居然没有qml文件! 在stack overflow上找到相关的问题:​​​ 原来在使用macdeployqt打包的时候需要指定qml文件的地址。 也即:​​​macdeployqt enVocabulary.app/ -qmldir=/Users/weiyang/code/enVocabulary -dmg​​​ 然后在​​​enVocabulary.app//Contents/Resources/qml/​​​ 就能看到各种qml, qmlc文件了 之后,编译运行,一切正常!

No rule to make target

类似于这样的报错:

mingw32-make[1]: *** No rule to make target '../enVocabulary/image/res.rc', needed by 'OBJ/res_res.o'. Stop.

不一定是Makefile的问题,很有可能是根本没有文件​​../enVocabulary/image/res.rc​​(名字写错了)

qt-work.ssl: QSslSocket: cannot resolve

我的程序使用了network相关的类,然后运行报错:

qt-work.ssl: QSslSocket: cannot resolve CRYPTO_num_locksqt-work.ssl: QSslSocket: cannot resolve CRYPTO_set_id_callbackqt-work.ssl: QSslSocket: cannot resolve CRYPTO_set_locking_callbackqt-work.ssl: QSslSocket: cannot resolve ERR_free_strings...qt-work.ssl: QSslSocket: cannot resolve SSLv3_client_methodqt-work.ssl: QSslSocket: cannot resolve SSLv23_client_methodqt-work.ssl: QSslSocket: cannot resolve SSLv2_server_methodqt-work.ssl: QSslSocket: cannot resolve SSLv3_server_methodqt-work.ssl: QSslSocket: cannot resolve SSLv23_server_methodqt-work.ssl: QSslSocket: cannot resolve X509_STORE_CTX_get_chainqt-work.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconfqt-work.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_confqt-work.ssl: QSslSocket: cannot resolve SSLeayqt-work.ssl: QSslSocket: cannot resolve SSLeay_version

当前的QT版本是5.9.2,我用代码打印SSL相关的信息:

qDebug()<<"SSL version use for build: "<

结果:

SSL version use for build: "OpenSSL 1.0.1e-fips 11 Feb 2013"qt-work.ssl: Incompatible version of OpenSSLSSL version use for run-time: ""false

在stack overflow上一顿查询,什么重新-openssl再编译,QT组件修复等方法都尝试了一遍,没用。

然后逛qt官网,希望最新版本的QT能解决这个问题。​​ 果然让我找到了相关的信息:

-Qt5.10.1,安装后重新运行:

SSL version use for build: "OpenSSL 1.0.2k-fips 26 Jan 2017"SSL version use for run-time: "OpenSSL 1.0.2g 1 Mar 2016"true

但我在后面的log(考虑到容错性,我加了许多的DEBUG)中发现了新的问题:​​The issuer certificate of a locally looked up certificate could not be found​​​ 这是为什么?我在terminal中启动openssl,然后它提示找不到库文件,我将libcrypto.so, libssl.so相关的四个文件全部放进/usr/lib中,然后可以正常启动了。

parallels@parallels-vm:~/Downloads/openssl-1.1.1-pre4$ openssl versionOpenSSL 1.1.1-pre4 (beta) 3 Apr 2018

但是Qt运行报错:

SSL version use for build: "OpenSSL 1.0.2k-fips 26 Jan 2017"...qt-work.ssl: QSslSocket: cannot resolve OPENSSL_add_all_algorithms_confqt-work.ssl: QSslSocket: cannot resolve SSLeayqt-work.ssl: Incompatible version of OpenSSL...qt-work.ssl: Incompatible version of OpenSSLSSL version use for run-time: "" SSL version use for

版本不兼容,好烦。。。 参照之前的log,我-了openssl 1.0.2g:​​​ 编译,安装,然后创建软连接:​​​ln -s /home/parallels/Downloads/openssl-1.0.2g/apps/openssl /usr/local/bin/openssl​​​ 但是版本不兼容的错误仍然存在!回想自己是将libcrypto.so, libssl.so相关的四个文件全部放进/usr/lib中然后就出现了兼容性问题。我又将/usr/lib路径下的​​​*crypto.so*​​​,​​*ssl.so*​​​的四个文件统统删除了。 然后运行,perfect!

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:【github notepad】QT 自动备份,(正则表达式)搜索替换
下一篇:DBUS入门笔记
相关文章

 发表评论

暂时没有评论,来抢沙发吧~