3

I am trying to compile the cpp code in visual studio 2013. It was working fine earlier. But now I am getting following error:

Error 1 error C1083: Cannot open include file: 'crtdbg.h': No such file or directory C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h 250 1 IDEditor

I checked crtdbg.h. This file exist in "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include" path.

Looks like it is not able to include above directory. I tried adding path in properties but still getting same problem.

$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include

Please help

Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116
Ashwani Kumar
  • 31
  • 1
  • 2

2 Answers2

1

I have resolved this issue, by adding manually the missing files : crtdbg.h then ucrt.lib.

  1. crtdbg.h

    Select : VC++ Repositories => Menu General => include repositories

    Add:(Exemple for me, on x64 platform, you can search where is located this file in your machine then add the correct path)

    C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt
    
  2. ucrt.lib

    Select : links editor => additional library directories

    Add:(Exemple for me, on x64 platform, you can search where is located this file in your machine then add the correct path)

    C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64
    
  3. Clean your project then rebuild and execute the project.

You should have no errors and a compilation successfull then the console display "Hello world".

Christopher
  • 3,124
  • 2
  • 12
  • 29
OldSchool
  • 11
  • 1
0

I think that Visual Studio can't access to header file, crtdbg.h , Pease test a simple following way. Maybe it solve your problem:

1- Run as administrator Visual Studio. I emphasized run as administrator no run.

2- Open your project.

3- Add the include path in the properties.

4- Happy coding and enjoy it.

mm.persian
  • 21
  • 3