吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 583|回复: 10
收起左侧

[讨论] Qt5.6.0 如何静态编译?

[复制链接]
董督秀 发表于 2023-12-14 19:53
    Qt默认是动态编译的,这就导致编译后的程序需要一些运行库才有可能跨平台执行。
    那么,Qt5.6.0 如何静态编译?    我的期望是,首先编译出Qt5.6.0支持MSVC 2015的静态库(static)
    搜索了一些流程,有说磁盘空间预备15GB/30GB/120GB不等,并且编译需要2~3小时。
    有尝试过的前辈能否给出一些指导或者教程参考?

免费评分

参与人数 1吾爱币 +1 热心值 +1 收起 理由
wh7115 + 1 + 1 热心回复!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

chenzhigang 发表于 2023-12-14 20:22
就官方这个 https://doc.qt.io/qt-5/windows-building.html   configure 的时候加上-static   不行吗  慢是肯定的 一般笔记本要3小时以上

免费评分

参与人数 1热心值 +1 收起 理由
董督秀 + 1 热心回复!

查看全部评分

Emily小安 发表于 2023-12-14 20:36

就官方这个 https://doc.qt.io/qt-5/windows-building.html   configure 的时候加上-static   不行吗  慢是肯定的 一般笔记本要3小时以上
fyh505099 发表于 2023-12-14 21:46
我这跑了一个小时,匡`一个报错 stop了

免费评分

参与人数 1热心值 +1 收起 理由
董督秀 + 1 唉,编译那么难吗。

查看全部评分

fyh505099 发表于 2023-12-14 22:44
不会就难 太恶心了
yhym599 发表于 2023-12-14 22:46
尝试过编译5.6.0的静态版本,错误太多,暂时放弃了。以下是5.15.2的静态版本,在github上找到的:
https://github.com/martinrotter/qt-minimalistic-builds/releases/tag/5.15.2

免费评分

参与人数 1热心值 +1 收起 理由
董督秀 + 1 热心回复!

查看全部评分

fyh505099 发表于 2023-12-14 23:14
yhym599 发表于 2023-12-14 22:46
尝试过编译5.6.0的静态版本,错误太多,暂时放弃了。以下是5.15.2的静态版本,在github上找到的:
https:/ ...

这个版本能用在QT5.6.0的项目上吗
evea 发表于 2023-12-15 09:46
我前两天用2022编译的。共参考
安装 ActivePerl-5.26.1.2601-MSWin32-x64-404865.exe 添加到 path
    安装 PYthon 添加到 path
    安装 rubyinstaller-2.7.8-1-x64.exe   添加到 path

    MathExtras.h   
    把 log2  log2f  lrint 注释掉  #if 一起注释


1   x64 Native Tools Command Prompt for VS 2022
2   configure -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -static -static-runtime -force-debug-info -prefix "D:\Qt\5.6.0\x64_static_msvc2022_MT" -qt-sql-sqlite -qt-sql-odbc -plugin-sql-sqlite -plugin-sql-odbc -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -nomake tests -no-compile-examples -nomake examples -skip webengine
3   nmake clean
4   nmake
5   nmake install



1   x86 Native Tools Command Prompt for VS 2022
2   configure -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -static -static-runtime -force-debug-info -prefix "D:\Qt\5.6.0\static_msvc2022_MT" -qt-sql-sqlite -qt-sql-odbc -plugin-sql-sqlite -plugin-sql-odbc -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -nomake tests -no-compile-examples -nomake examples -skip webengine
3   nmake clean
4   nmake
5   nmake install

免费评分

参与人数 1吾爱币 +1 收起 理由
董督秀 + 1 谢谢@Thanks!

查看全部评分

evea 发表于 2023-12-15 09:48
编译完17G。
 楼主| 董督秀 发表于 2023-12-15 18:51
evea 发表于 2023-12-15 09:46
我前两天用2022编译的。共参考
安装 ActivePerl-5.26.1.2601-MSWin32-x64-404865.exe 添加到 path
    安 ...

ActivePerl-5.26.1.2601-MSWin32-x64-404865.exe
rubyinstaller-2.7.8-1-x64.exe
这两个安装包能否分享下呢?

python的版本是什么?

编译的时候,预留磁盘空间是多少?
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-17 01:20

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表