The Distinguish of the share or static lib in MFC
如果選擇Use MFC in a Static Library ,那你編譯后的程序就直接包含了調用MFC的部分的庫,文件可能會大一些,但是可以直接移到其他機器上運行。
?
前者是動態連接,發布要帶MFC得DLL文件。
后者是靜態鏈接,發布不用帶MFC的DLL文件。???
如果可執行文件只有一個,使用前者,執行速度快,但文件比較大。
如果可執行文件多個,使用后者,因為DLL文件是共享的,所以文件體積總量減少。
單個文件也小。加載執行塊,但運行速度略比前者慢。??
used in a static library:
使用lib文件。lib是已經編譯好的二進制文件,可以與你的工程靜態鏈接起來成為一個exe。???
used in a shared dll:
使用dll文件,函數實現隱藏在DLL文件內部,你的工程編譯成exe文件后,運行時才調用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.
?
轉載于:https://www.cnblogs.com/CBDoctor/archive/2013/01/18/2865889.html
總結
以上是生活随笔為你收集整理的The Distinguish of the share or static lib in MFC的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Javascript图像处理之将彩色图转
- 下一篇: 编写你自己的单点登录(SSO)服务(转)