pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

我是否必須在我的應(yīng)用程序中包含所有這些 Qt

Do I have to include all these Qt dlls with my application?(我是否必須在我的應(yīng)用程序中包含所有這些 Qt dll?)
本文介紹了我是否必須在我的應(yīng)用程序中包含所有這些 Qt dll?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我是 Qt 的新手,我不知道很多東西.

I'm totally new in using Qt and I don't know a lot of stuff.

作為測(cè)試,我使用 Visual Studio 2012 和基于最新 Qt5.1

As a test I created a simple application using Visual Studio 2012 and Qt-VS-Add-in based on the newest Qt5.1

我編譯應(yīng)用程序后它對(duì)我不起作用(給出錯(cuò)誤),我在互聯(lián)網(wǎng)上搜索,發(fā)現(xiàn)很多人說(shuō)我必須從目錄中復(fù)制下面提到的那些dll:

After I compiled the application it didn't work for me (gave errors), I searched all over the internet and found a lot of people saying that I have to copy those dlls mentioned below from the directory:

C:QtQt5.1.05.1.0msvc2012in

我必須復(fù)制 DLL 才能使我的應(yīng)用程序正常工作:

DLL's I had to copy to make my application work:

icudt51.dll
icuin51.dll
icuuc51.dll
libEGL.dll
libGLESv2.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll

我的問(wèn)題是這些 dll 的大小,它們大約為37 MB",而我的應(yīng)用程序本身只有30 KB"!因此,這些 Qt 庫(kù)將至少為我的應(yīng)用程序增加 37 MB [我沒(méi)有看到我下載的其他基于 Qt 的應(yīng)用程序會(huì)發(fā)生這種情況].有什么解決方案可以讓我最終得到一個(gè)小的 .exe 文件嗎?!

My problem is the size of these dlls, they're about "37 MB" and my application itself is only "30 KB"! So, those Qt libraries will add at least 37 MB to my application [ Which I don't see it happens with other Qt-based applications I download ]. Is there any solution can make me end up with a single small .exe file?!

而且我聽(tīng)到有人說(shuō)我還必須為 Microsoft C++ Compiler 包含一個(gè) dll,您能為我解釋一下嗎?

And I heard some people saying that I have to also include a dll for Microsoft C++ Compiler, can you explain this for me?

注意:我在 StackOverFlow 上遇到了很多問(wèn)題,但我找不到任何可以幫助我的問(wèn)題,所以請(qǐng)不要將其標(biāo)記為重復(fù),因?yàn)槿绻艺业搅嗣鞔_的回答我不會(huì)發(fā)布這個(gè)問(wèn)題!

Note: I've come across a lot of questions here on StackOverFlow but I couldn't find anything can help me, so please do not flag this as a duplication because if I found a clear answer I wouldn't post this question!

任何幫助將不勝感激.

推薦答案

更新:使用windeployqt.exe!效果非常好.

UPDATE: Use windeployqt.exe! It works really well.

http://doc.qt.io/qt-5/windows-deployment.html#the-windows-deployment-tool

使用windeployqt最簡(jiǎn)單的方法就是在bin目錄下添加您的 Qt 安裝(例如)到 PATH 變量,然后運(yùn)行:

The simplest way to use windeployqt is to add the bin directory of your Qt installation (e.g. ) to the PATH variable and then run:

windeployqt <path-to-app-binary>

更新:經(jīng)過(guò)進(jìn)一步測(cè)試,windeployqt 沒(méi)有為我復(fù)制所有的 MingW dll.(在 Windows 10 和 MingW 4.9.1 上用 Qt 5.4 測(cè)試).所以需要在部署前手動(dòng)獲取最后3個(gè)dll:

UPDATE: Upon Further testing, windeployqt did not copy over all the MingW dlls for me. (Tested with Qt 5.4 on Windows 10 with MingW 4.9.1). So you need to manually get the last 3 dlls before deploying:

libgcc_s_dw2-1.dll
libstdc++-6.dll
libwinpthread-1.dll

來(lái)自

C:Qt5.4mingw491_32in

<小時(shí)>

我想你的列表中可能有一些額外的東西......我會(huì)仔細(xì)檢查下面鏈接中的文檔......


I think you may have a few extras in your list... I would double check the docs in the links below...

這是關(guān)于它的權(quán)威文檔:

Here is the definitive documentation on it:

http://doc.qt.io/qt-5/windows-部署.html

http://doc.qt.io/qt-5/windows-deployment.html#application-dependencies

令人驚嘆的 Qt 庫(kù)可以做很多事情,但它們有點(diǎn)大.一些舊版本的 Qt 可能要小一些.

The amazing Qt Libraries can do a lot, but they are kind of big. Some of the older versions of Qt might be a little smaller.

對(duì)于 Qt 4.8 msvc,QtCore4.dll 為 2.5 MB,QtGui4.dll 為 8.4 MB.

For Qt 4.8 msvc QtCore4.dll is 2.5 MB, and QtGui4.dll is 8.4 MB.

以下是 Windows 在運(yùn)行時(shí)跟蹤庫(kù)的方式:

Here is how Windows tracks down a library at runtime:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx

如果您靜態(tài)鏈接,那么您的 EXE 應(yīng)該獲取它需要的庫(kù)并構(gòu)建到一個(gè)獨(dú)立的 exe 中.它仍然可能依賴(lài)于 msvc 可再發(fā)行組件.有關(guān)更多信息,請(qǐng)參閱下一節(jié).但它現(xiàn)在將您引用到 EXE 的 .lib 編譯下來(lái),并且您的 exe 不再指向其他動(dòng)態(tài)鏈接庫(kù).設(shè)置靜態(tài)鏈接的 exe 環(huán)境確實(shí)需要更多時(shí)間.

If you statically link, then your EXE should grab the libraries it needs and gets built into a stand alone exe. It still may be dependent on msvc redistributables. See the next section for more info on it. But it now compiles down the .libs that you reference into your EXE and your exe no longer is pointing at other dynamically linked libraries. It does take more time to get your statically linked exe environment setup.

您的 exe 肯定會(huì)變得更大,因?yàn)樗F(xiàn)在包含您之前引用的庫(kù)的二進(jìn)制信息.

Your exe will certainly get bigger as it now includes the binary information for the libraries that you referenced before.

https://www.google.com/search?q=qt+靜態(tài)+鏈接

靜態(tài)構(gòu)建 exe,意味著您沒(méi)有使用 LGPL 版本.這意味著如果您使用 LGPL,您必須讓最終用戶(hù)易于訪問(wèn)您的目標(biāo)文件.

Statically building the exe, means that you aren't using the LGPL version. means that you have to have your object files easy to access to end users if you are using LGPL.

我認(rèn)為@peppe 描述得很好(見(jiàn)下面的評(píng)論):

I think @peppe described it well (see comment below):

從技術(shù)上講,在 LGPL 下使用 Qt 時(shí)允許靜態(tài)鏈接,即使您的應(yīng)用程序未使用 LGPL.唯一棘手的要求是讓第三方能夠?qū)⒛膽?yīng)用程序重新鏈接到不同的 Qt 版本.但是你可以很容易地遵守,f.i.通過(guò)為您的應(yīng)用程序提供一個(gè)巨大的目標(biāo)文件 (.o),只需將其鏈接到任何 Qt 版本即可.

Technically, you are allowed to statically link when using Qt under LGPL, even if your application is not using LGPL. The only tricky requirement is keeping the ability for a third party to relink your application against a different Qt version. But you can comply with that easily, f.i. by providing a huge object file (.o) of your application, that only needs to be linked against any Qt version.

http://blog.qt.io/blog/2009/11/30/qt-making-the-right-licensing-decision/

查看底部附近的圖表.如果你做的是商業(yè)版,那么你可以靜態(tài)鏈接,不用擔(dān)心目標(biāo)文件.

Look at the chart near the bottom. If you are doing the commercial version, then you can statically link, without worrying about the object files.

可再發(fā)行依賴(lài)項(xiàng)與運(yùn)行時(shí)庫(kù)鏈接器選項(xiàng)有關(guān).

Redistributable dependencies have to do with the run-time library linker options.

http://msdn.microsoft.com/en-us/library/aa278396(v=vs.60).aspx

/MD、/ML、/MT、/LD(使用運(yùn)行庫(kù))

要在開(kāi)發(fā)環(huán)境中找到這些選項(xiàng),請(qǐng)單擊項(xiàng)目"菜單上的設(shè)置".然后單擊 C/C++ 選項(xiàng)卡,然后單擊類(lèi)別框中的代碼生成.請(qǐng)參閱使用運(yùn)行時(shí)庫(kù)下拉框.

To find these options in the development environment, click Settings on the Project menu. Then click the C/C++ tab, and click Code Generation in the Category box. See the Use Run-Time Library drop-down box.

下面這兩個(gè)鏈接討論了一些舊版本的visual studio,但推理應(yīng)該仍然成立.

These two links below talk about some older versions of visual studio, but the reasoning should still stand.

http://www.davidlenihan.com/2008/01/choosing_the_correct_cc_runtim.html

如何使用 Visual Studio Express 2005 制作一個(gè)完全靜態(tài)鏈接的 .exe 嗎?

希望有所幫助.

這篇關(guān)于我是否必須在我的應(yīng)用程序中包含所有這些 Qt dll?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數(shù)據(jù)?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫(xiě) for() 循環(huán): for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環(huán)?)
Reusing thread in loop c++(在循環(huán) C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環(huán)形?)
主站蜘蛛池模板: _网名词典_网名大全_qq网名_情侣网名_个性网名 | 首页-瓜尔胶系列-化工单体系列-油田压裂助剂-瓜尔胶厂家-山东广浦生物科技有限公司 | 酸度计_PH计_特斯拉计-西安云仪 纯水电导率测定仪-万用气体检测仪-低钠测定仪-米沃奇科技(北京)有限公司www.milwaukeeinst.cn | 扬尘在线监测系统_工地噪声扬尘检测仪_扬尘监测系统_贝塔射线扬尘监测设备「风途物联网科技」 | 超声波气象站_防爆气象站_空气质量监测站_负氧离子检测仪-风途物联网 | 衬塑设备,衬四氟设备,衬氟设备-淄博鲲鹏防腐设备有限公司 | 专业的新乡振动筛厂家-振动筛品质保障-环保振动筛价格—新乡市德科筛分机械有限公司 | 振动时效_振动时效仪_超声波冲击设备-济南驰奥机电设备有限公司 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 热闷罐-高温罐-钢渣热闷罐-山东鑫泰鑫智能热闷罐厂家 | 可程式恒温恒湿试验箱|恒温恒湿箱|恒温恒湿试验箱|恒温恒湿老化试验箱|高低温试验箱价格报价-广东德瑞检测设备有限公司 | 金属检测机_金属分离器_检针验针机_食品药品金属检探测仪器-广东善安科技 | 高通量组织研磨仪-多样品组织研磨仪-全自动组织研磨仪-研磨者科技(广州)有限公司 | 钛合金标准件-钛合金螺丝-钛管件-钛合金棒-钛合金板-钛合金锻件-宝鸡远航钛业有限公司 | 硫化罐-胶管硫化罐-山东鑫泰鑫智能装备有限公司| 鹤壁创新仪器公司-全自动量热仪,定硫仪,煤炭测硫仪,灰熔点测定仪,快速自动测氢仪,工业分析仪,煤质化验仪器 | 耳模扫描仪-定制耳机设计软件-DLP打印机-asiga打印机-fitshape「飞特西普」 | 户外健身路径_小区健身器材_室外健身器材厂家_价格-浩然体育 | GAST/BRIWATEC/CINCINNATI/KARL-KLEIN/ZIEHL-ABEGG风机|亚喜科技 | 无锡门窗-系统门窗-阳光房-封阳台-断桥铝门窗厂[窗致美] | 超声波流量计_流量标准装置生产厂家 _河南盛天精密测控 | 有福网(yofus.com)洗照片冲印,毕业聚会纪念册相册制作个性DIY平台 | 分类168信息网 - 分类信息网 免费发布与查询| 水厂污泥地磅|污泥处理地磅厂家|地磅无人值守称重系统升级改造|地磅自动称重系统维修-河南成辉电子科技有限公司 | 招商帮-一站式网络营销服务|搜索营销推广|信息流推广|短视视频营销推广|互联网整合营销|网络推广代运营|招商帮企业招商好帮手 | 欧景装饰设计工程有限公司-无锡欧景装饰官网 | 超声波电磁流量计-液位计-孔板流量计-料位计-江苏信仪自动化仪表有限公司 | 等离子空气净化器_医用空气消毒机_空气净化消毒机_中央家用新风系统厂家_利安达官网 | 制丸机,小型中药制丸机,全自动制丸机价格-甘肃恒跃制药设备有限公司 | 小港信息港-鹤壁信息港 鹤壁老百姓便民生活信息网站 | 美国PARKER齿轮泵,美国PARKER柱塞泵,美国PARKER叶片泵,美国PARKER电磁阀,美国PARKER比例阀-上海维特锐实业发展有限公司二部 | 范秘书_懂你的范文小秘书| 滚筒烘干机_转筒烘干机_滚筒干燥机_转筒干燥机_回转烘干机_回转干燥机-设备生产厂家 | 广东青藤环境科技有限公司-水质检测 | RTO换向阀_VOC高温阀门_加热炉切断阀_双偏心软密封蝶阀_煤气蝶阀_提升阀-湖北霍科德阀门有限公司 | 石家庄网站建设|石家庄网站制作|石家庄小程序开发|石家庄微信开发|网站建设公司|网站制作公司|微信小程序开发|手机APP开发|软件开发 | 挤塑板-XPS挤塑板-挤塑板设备厂家[襄阳欧格] | 台湾HIWIN上银直线模组|导轨滑块|TBI滚珠丝杆丝杠-深圳汉工 | 天津散热器_天津暖气片_天津安尼威尔散热器制造有限公司 | 浙江清风侠环保设备有限公司| 针焰试验仪,灼热丝试验仪,漏电起痕试验仪,水平垂直燃烧试验仪 - 苏州亚诺天下仪器有限公司 | 专业生物有机肥造粒机,粉状有机肥生产线,槽式翻堆机厂家-郑州华之强重工科技有限公司 |