Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error LNK1104: cannot open file 'MSVCRT.lib'

I know there's a lot of question like this one, but no one of those answers help me to solve my problem. What problem? Well, when linking, after compiling my project I receive this:

fatal error LNK1104: cannot open file 'MSVCRT.lib'

I'm using CodeBlocks under Windows 8 64-bit. Compiling with the Visual C++ 2003 Toolkit compiler, which I have installed under C:\Program Files (x86)\Visual C++ 2003 Toolkit and using a lot functions from the Windows API, which I also have installed under C:\Program Files (x86)\Windows Kits).

Searching on the internet I found some solutions like to link this library (MSVCRT.lib) under my project settings, but I definitely don't have that file. This is a project (the one in which I'm receiving this error) that I was working on about 15 days ago, and now I want to resume its development. I compiled and linked this project a lot of times, and I never got this linker error, I don't know why now I just can't link it.

Some solutions say I need to install VS.NET so the MSVCRT.lib file will be there, but I never had that installed and I was able to compile and link my project!

Any ideas on how can I solve this without installing VS.NET (also, I don't know if this is going to work)?

like image 717
cdonts Avatar asked Feb 18 '26 01:02

cdonts


2 Answers

After 2 years, I finally found the solution in my case.

In CodeBlocks, under Project > Build Options > Compiler Flags, remove Multi-threaded DLL Runtime Library [/MD] and rebuild.

like image 71
cdonts Avatar answered Feb 20 '26 13:02

cdonts


What just did it for me, was to delete the .sdf and .suo files.

like image 39
zigah Avatar answered Feb 20 '26 15:02

zigah