1. 程式人生 > >How to link with the correct C Run-Time (CRT) library

How to link with the correct C Run-Time (CRT) library

SUMMARY
There are six types of reusable libraries:
  • Static Single Threaded Library (Debug/Release)
  • Static Multithreaded Library (Debug/Release)
  • Dynamic Link Library (DLL)(Debug/Release)
Note Each library has a debug version and a release version.

The DLL is multithread-safe and a single-thread version of the CRT library is not provided for DLLs. If the reusable library or any user of the library is using multiple threads, then the library needs to be a multithread-safe library type. 

Note
 Debug libraries and compiler switches /MLd, /MTd, and /MDd are only available in Visual C++ versions 4.0 and later. 

The following table shows which compiler switch should be used for building each of the six types of reusable libraries (all DLL types are multithread-safe). Any project that uses the reusable library should use the same compiler switch. When using the /ML(default), /MLd, /MT, /MTd, /MD, or /MDd compiler switches, the compiler places the default library name (listed under the Library column) in the object file.
Reusable Library            Switch    Library    Macro(s) Defined
----------------------------------------------------------------
Single Threaded             /ML       LIBC       (none)
Static MultiThread          /MT       LIBCMT     _MT
Dynamic Link (DLL)          /MD       MSVCRT     _MT and _DLL
Debug Single Threaded       /MLd      LIBCD      _DEBUG
Debug Static MultiThread    /MTd      LIBCMTD    _DEBUG and _MT
Debug Dynamic Link (DLL)    /MDd      MSVCRTD    _DEBUG, _MT, and _DLL
				
You can view an object module to determine which switch was used when it was built by using this command:

   dumpbin /all <object>.obj
				
Look in the section titled RAW DATA #1. In the right-most column, the default libraries will be listed.

相關推薦

How to link with the correct C Run-Time (CRT) library

SUMMARY There are six types of reusable libraries: Static Single Threaded Library (Debug/Release)Static Multithreaded Library (Debug/Release)Dynamic Li

How to do if the GM MDI cant connect with the software

When you use GM MDI on your laptop , you may meet some troubles . Such as it cant communicate with the software . Lets see how to solve this issue . F

Bring Colorless Wooden Surfaces To Life With The Right Stain Colors

needed ID from beginning infinite open www. ted BE Staining wood is not just a job to make the wooden stuff look appealing but also a

svn: E155021: This client is too old to work with the working copy at..... No changes detected

伺服器svn版本1.6+ ,IDEA版本2017.1.5 java JDK 1.8.0_91 網上搜到大部分是讓upgrade,但是眾所周知Idea是死活找不到upgrade鍵的,思索還是版本不對應的原因,最終解決辦法是: 頻繁的試,從svn版本1.9.+一直往下試,試到1.6.+,最

VSphere隨筆 - vCenter6.5安裝報錯 “Failed to authenticate with the guest operating system using the supplied“

今天重新安裝VCSA,安裝多次一直卡在80%的畫面不動,顯示正在安裝RPM包,同時log日誌顯示“Failed to authenticate with the guest operating system using the supplied ”,登入控制檯檢視VCSA伺服器進度發現root密碼沒

提問的智慧(How-To-Ask-Questions-The-Smart-Way)

簡介 在黑客的世界裡,當你丟擲一個技術問題時,最終是否能得到有用的回答,往往取決於你所提問和追問的方式。本指南將教你如何正確的提問以獲得你滿意的答案。 不只是黑客,現在開源(Open Source)軟體已經相當盛行,你常常也可以由其他有經驗的使用者身上得到好答案,這是件好

odoo學習必看-提問的智慧《How To Ask Questions The Smart Way》

odoo學習必看-提問的智慧《How To Ask Questions The Smart Way》 轉自:https://www.sunpop.cn/how-ask-questions-smart-way/ 人必自助而後人助之,而後天助之。出自《周易·繫辭上》 odoo和

How to split a string in C++

Java has String.split(), Python has string.split(), Perl has split. There is no simple string-splitting method in C++, but there are plenty of way

Components testing in React: what and how to test with Jest and Enzyme.

Testing React components may be challenging for beginners as well as experienced developers who have already worked with tests. It may be interesting to co

How to deal with ConcurrentModificationException in Java? Beware while removing elements from ArrayList in loop

One of the common problem while removing elements from an ArrayList in Java is the ConcurrentModificationException. If you use classical for loop with the

The Story of How I Dealt With The Accumulated Stress And Depression This Summer

This whole summer I’ve been dealing with the accumulated stress and depression. And I’ve won! Here is how I did that without taking any time off work:Go to

Australia’s Design capability gap, how it hurts organisations & how to avoid hiring the wrong…

Australia’s Design capability gap, how it hurts organisations & how to avoid hiring the wrong peopleThe majority of people in design roles don’t have t

Hello World, book review: Algorithms, and how to live with them

The trajectory of books about new technologies follows a similar pattern: first, hype; then, backlash; then, finally, a more considered view of what it mig

The Pixel 3's coolest features have nothing to do with the phone

Interfaces and hardware shaped the last decade of smartphone innovation, but artificial intelligence will shape the next decade. Nowhere is that more obvio

How to use Shasta, the free energy market

How to use Shasta, the free energy marketFor those who don’t know what Shasta is, I recommend reading this post: Introducing Shasta: The Future of Energy.S

Ask HN: How to break out the loop of being an employee to your own business?

I'm doing exactly that right now. Hired for a decent salary - but quiting.I don't know what ill be doing in 6 months. I don't have a financial buffer. This

A Virtual Jewish Nation May Teach the World How to Live on the Cloud

A Virtual Jewish Nation May Teach the World How to Live on the CloudWe’re all familiar with “the cloud.” But have heard about “cloud nations”?If you ask fu

Ask HN: Which can be the best way to communicate with the user?

I work with a cms and the eternal argument with the clients is how to interact with the users of the website. WhatsApp business or chatbot?

How to deal with hyper growth?

Hello,I would like to understand some of the strategies how to deal with hyper growth? For example we need to add around 10 engineers a month, it is taking

How to Work with PMs

Photo by Christopher WongHow to Work with PMsA Cheat Sheet for DesignersOnce, a long time ago, I was a product manager. Then, I was an engineer. For the pa