日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

The Distinguish of the share or static lib in MFC

發(fā)布時(shí)間:2024/1/17 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 The Distinguish of the share or static lib in MFC 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
如果選擇use MFC in a Shared DLL 的話,你編譯后的程序中不包含MFC庫(kù),所以文件會(huì)比較小,但是如果你的程序直接移到一個(gè)沒(méi)有安裝過(guò)MFC的機(jī)器上時(shí),可能會(huì)導(dǎo)致找不到MFC的DLL。

如果選擇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)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。