Qt 静态构建 - 不可能的大小 [英] Qt static build - impossible size

查看:66
本文介绍了Qt 静态构建 - 不可能的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Qt 编程很陌生,我很长时间都试图了解链接库的工作原理.我需要分发一个小程序 - 1000 行左右 - 我开发给几个人.
我静态构建 Qt 因为我需要静态构建,现在我的程序大小急剧增加.

我只使用 Qpushbuttons、Qlinedits、Qlabels 和其他一些东西,我最终得到了一个超过 160Mb 的编译程序,而只有几 MB 是合理的.
我假设它包含不需要的库和类(仅解释).如何在静态构建中保持可接受的大小?

I am quite new to Qt programming, and i tried long to understand how linking the libraries work. I need to distribute a small program - 1000 lines or so - that i developed to a few people.
I built statically Qt because I need a static build, and now my programs size increased drammatically.

I only use Qpushbuttons, Qlinedits, Qlabels, and a few more things and I ended up with a compiled program of over 160Mb, while just a few MB would be reasonable.
I assume it included unwanted libraries and classes (only explanation). How can I keep the size something acceptable with a static build?

我正在运行 64 位 linux,需要按原样进行编译.

I'm running linux 64bit and need to compile as such and for it.

谢谢

推荐答案

我假设您正在调试模式下进行项目构建.我建议在发布模式下构建应用程序.输出文件的大小将大大减少.

I'm assuming that you are doing a project build in debug mode. I propose to build application in the release mode. The size of the output file will decrease dramatically.

这篇关于Qt 静态构建 - 不可能的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆