Qt creator 默认是静态还是动态链接它的库? [英] Does Qt creator by default statically or dynamically link it's libraries?

查看:36
本文介绍了Qt creator 默认是静态还是动态链接它的库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个闭源应用程序,为了按照 LGPL 进行开发,我必须将 Qt 的库动态链接到我的应用程序.Qt 是默认执行此操作还是我必须采取措施来执行此操作?如果是这样的话,我会怎么做呢?

I'm developing a closed source application and to do so in accordance with the LGPL I have to dynamically link Qt's libraries to my application. Does Qt do this by default or do I have to take steps to do so? If that's the case how would I go about doing it?

推荐答案

Qt 默认使用动态链接.

在部署到非开发人员机器期间,您会立即注意到这一点,因为如果没有 Qt 库,您的代码将无法运行.

You'll notice this immediately during deployment to a non-developer machine, because your code will not run without the Qt libraries.

如果您关心的是 LGPL,那么在编译 Qt 本身时要小心.大多数与 Qt 的 LGPL 冲突不是因为静态链接(因为默认是动态链接),而是因为使用非默认参数编译 Qt.

If your concern is the LGPL, just be careful when compiling Qt itself. Most LGPL violations with Qt are not because of static linking (since dynamic is the default), but for compiling Qt with non-default parameters.

LGPL 不仅是库必须随二进制文件一起提供,还包括您指定用户如何自行构建 LGPL 部分.如果您自己编译 Qt 并且不使用网站上的预编译二进制文件,则必须在版本中记录构建配置的那部分!

LGPL is not just that the library must be provided along your binaries, but also that you specify how your users can build themselves the LGPL part. If you compile Qt yourself and do not use the pre-compiled binaries from the website, you must document that part of your build configuration in your release!

一旦您的程序运行了一些东西,就开始为未安装 Qt 的非开发人员环境准备发布版本.一旦您删除了必须随程序复制的 DLL(或您的操作系统使用的任何格式),您的程序就会失败.

As soon as you get something running on your program, start preparing a release version for a non-developer environment without Qt installed. Your program should fail as soon as you delete the DLLs that you must copy along your program (or whatever format your OS uses).

这篇关于Qt creator 默认是静态还是动态链接它的库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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