Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
961 views
in Technique[技术] by (71.8m points)

c++ - LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'

I'm a novice C++ developer. I encontered the error message indicates "LINK :fatal error LNK1104: cannot open file 'MSVCRTD.lib'" while I'm trying to debug every single project in Microsoft Visual C++ 2010 Express. I searched on Stack overflow and Google for any possible resolution, but I couldn't find exact and precise answer. What I have understood is that the "msvcrtd.lib" file should be in "Microsoft Visual Studio 10.0VClib", but that file is not there in my case. What should I do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For the poor souls out there who are struggling with this, after an hour of research I found a solution for my Visual Studio Enterprise 2017:

First, lets find where is your library file located:

With windows explorer, go to your directory where Visual Studio is installed, (default: C:Program Files (x86)Microsoft Visual Studio) and do a search for msvcrtd.lib

I found mine to be in here:

C:Program Files (x86)Microsoft Visual Studio2017EnterpriseVCToolsMSVC14.15.26726libonecorex86

Quick Fix (for one project only):

  1. Right click on your project, click on properties, navigate to Linker, add that path to Additional Library Directories enter image description here

Permanent Fix (for all projects)

  1. Open a project
  2. navigate to View > Property Manager (it could be under Other Windows)
  3. Expand all folders and multi select all "Microsoft.cpp.Win32.user" & "Microsoft.cpp.64.user"

enter image description here

  1. Right click and go to properties
  2. Navigate to VC++ Directories enter image description here

  3. Add the path to default Library Directories


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...