久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

問題描述

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

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

作為測試,我使用 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)用程序后它對我不起作用(給出錯誤),我在互聯(lián)網(wǎng)上搜索,發(fā)現(xiàn)很多人說我必須從目錄中復(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

我的問題是這些 dll 的大小,它們大約為37 MB",而我的應(yīng)用程序本身只有30 KB"!因此,這些 Qt 庫將至少為我的應(yīng)用程序增加 37 MB [我沒有看到我下載的其他基于 Qt 的應(yīng)用程序會發(fā)生這種情況].有什么解決方案可以讓我最終得到一個小的 .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?!

而且我聽到有人說我還必須為 Microsoft C++ Compiler 包含一個 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 上遇到了很多問題,但我找不到任何可以幫助我的問題,所以請不要將其標(biāo)記為重復(fù),因?yàn)槿绻艺业搅嗣鞔_的回答我不會發(fā)布這個問題!

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最簡單的方法就是在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)過進(jìn)一步測試,windeployqt 沒有為我復(fù)制所有的 MingW dll.(在 Windows 10 和 MingW 4.9.1 上用 Qt 5.4 測試).所以需要在部署前手動獲取最后3個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

來自

C:Qt5.4mingw491_32in

<小時>

我想你的列表中可能有一些額外的東西......我會仔細(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 庫可以做很多事情,但它們有點(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.

對于 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)行時跟蹤庫的方式:

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)該獲取它需要的庫并構(gòu)建到一個獨(dú)立的 exe 中.它仍然可能依賴于 msvc 可再發(fā)行組件.有關(guān)更多信息,請參閱下一節(jié).但它現(xiàn)在將您引用到 EXE 的 .lib 編譯下來,并且您的 exe 不再指向其他動態(tài)鏈接庫.設(shè)置靜態(tài)鏈接的 exe 環(huán)境確實(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 肯定會變得更大,因?yàn)樗F(xiàn)在包含您之前引用的庫的二進(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,意味著您沒有使用 LGPL 版本.這意味著如果您使用 LGPL,您必須讓最終用戶易于訪問您的目標(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 描述得很好(見下面的評論):

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

從技術(shù)上講,在 LGPL 下使用 Qt 時允許靜態(tài)鏈接,即使您的應(yīng)用程序未使用 LGPL.唯一棘手的要求是讓第三方能夠?qū)⒛膽?yīng)用程序重新鏈接到不同的 Qt 版本.但是你可以很容易地遵守,f.i.通過為您的應(yīng)用程序提供一個巨大的目標(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ā)行依賴項(xiàng)與運(yùn)行時庫鏈接器選項(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)行庫)

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

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.

下面這兩個鏈接討論了一些舊版本的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 制作一個完全靜態(tài)鏈接的 .exe 嗎?

希望有所幫助.

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

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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++ 中,為什么我不能像這樣編寫 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)形?)
主站蜘蛛池模板: 91精品国产乱码久久久久久久 | 精品久久久网站 | 91看片免费版| www.玖玖玖| 成人二区| 99av成人精品国语自产拍 | 黄页网址在线观看 | 欧美九九九 | 色资源站 | www.亚洲精品 | 激情五月婷婷丁香 | 欧美在线| 在线看黄免费 | 成人免费视频网站在线看 | 国产午夜三级一区二区三 | 精品在线观看一区 | 99精品在线观看 | 你懂的免费在线 | 全免费a级毛片免费看视频免费下 | 无码日韩精品一区二区免费 | 中文字幕一区二区三区四区不卡 | 欧美一级网站 | 成人黄色在线视频 | 亚洲国产成人精品女人久久久 | 99re视频在线观看 | 国产高清精品在线 | 91精品国产91久久久久久 | 99热精品在线观看 | 天天噜天天干 | 日韩精品999| 亚洲午夜小视频 | 一区中文字幕 | 欧美精品一区二区三区在线播放 | 亚洲一级视频在线 | 国产精品久久在线观看 | 国产精品美女久久久 | 久色激情 | 91精品国产高清一区二区三区 | 欧美一区二区另类 | 99国产精品久久久久老师 | 青青草原综合久久大伊人精品 |