The Distinguish of the share or static lib in MFC
如果選擇Use MFC in a Static Library ,那你編譯后的程序就直接包含了調(diào)用MFC的部分的庫(kù),文件可能會(huì)大一些,但是可以直接移到其他機(jī)器上運(yùn)行。
?
前者是動(dòng)態(tài)連接,發(fā)布要帶MFC得DLL文件。
后者是靜態(tài)鏈接,發(fā)布不用帶MFC的DLL文件。???
如果可執(zhí)行文件只有一個(gè),使用前者,執(zhí)行速度快,但文件比較大。
如果可執(zhí)行文件多個(gè),使用后者,因?yàn)镈LL文件是共享的,所以文件體積總量減少。
單個(gè)文件也小。加載執(zhí)行塊,但運(yùn)行速度略比前者慢。??
used in a static library:
使用lib文件。lib是已經(jīng)編譯好的二進(jìn)制文件,可以與你的工程靜態(tài)鏈接起來(lái)成為一個(gè)exe。???
used in a shared dll:
使用dll文件,函數(shù)實(shí)現(xiàn)隱藏在DLL文件內(nèi)部,你的工程編譯成exe文件后,運(yùn)行時(shí)才調(diào)用dll?? 。
?
------------------------------------------------------------------------------
?
A static library means the code you use from the library is included in your executable. Because of this, you don't need to ship the library or require the end user to have it on their machine. However this bloats the size of your executable and ties you to that library version, so if you need to update just the library, you have to ship a new executable.
?
A shared library calls the library at the time it needs it (runtime) to execute the code, but it requires the user to have it (usually a specific or minimum version) installed on their machine. You can also distribute the required version of the library with your application if you need to.
?
As for which is better, I don't know. I'm not a Windows C++ or MFC programmer so I couldn't say. On my Linux servers, the applications I write are generally server-side and thus use shared libraries.
?
It depends on how your application is to be used, distributed, updated, how often the MFC library changes, if it's generally available on user's PCs etc.
?
轉(zhuǎn)載于:https://www.cnblogs.com/CBDoctor/archive/2013/01/18/2865889.html
總結(jié)
以上是生活随笔為你收集整理的The Distinguish of the share or static lib in MFC的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Javascript图像处理之将彩色图转
- 下一篇: 编写你自己的单点登录(SSO)服务(转)