日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

The Distinguish of the share or static lib in MFC

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

如果選擇Use MFC in a Static Library ,那你編譯后的程序就直接包含了調(diào)用MFC的部分的庫,文件可能會大一些,但是可以直接移到其他機器上運行。

?

前者是動態(tài)連接,發(fā)布要帶MFC得DLL文件。

后者是靜態(tài)鏈接,發(fā)布不用帶MFC的DLL文件。???

如果可執(zhí)行文件只有一個,使用前者,執(zhí)行速度快,但文件比較大。
如果可執(zhí)行文件多個,使用后者,
因為DLL文件是共享的,所以文件體積總量減少。
單個文件也小。加載執(zhí)行塊,但運行速度略比前者慢。??

used in a static library:
使用lib文件。lib是已經(jīng)編譯好的二進制文件,可以與你的工程靜態(tài)鏈接起來成為一個exe。???
used in a shared dll:
使用dll文件,函數(shù)實現(xiàn)隱藏在DLL文件內(nèi)部,你的工程編譯成exe文件后,運行時才調(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的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

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