cannot open include file 'new.h': no such file or directory

Asha Diggi 96 Reputation points
2021-07-19T12:24:20.733+00:00

Hi All,

I am trying to run a simple mfc demo application in visual studio 2015, but i am not able to build that one successfully.

getting a error message "cannot open include file: 'new.h' : no such file or directory.

can any one please suggest me, what I am doing wrong,how to solve this error.

With Regards,
Asha.S.D

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,734 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. RLWA32 45,571 Reputation points
    2021-07-19T12:38:21.183+00:00

    You probably want to use #include <new>

    1 person found this answer helpful.
    0 comments No comments

  2. rupesh shukla 16 Reputation points
    2021-07-19T16:12:57.607+00:00

    Make sure that you have proper include file path listed in your solution for new.h. Search for new.h on your disk and add the file path to your include .You can find it either in your Windows Kits or Visual studio folder. Once you had added it then try to recompile your solution.

    Thanks

    0 comments No comments

  3. Jeanine Zhang-MSFT 9,676 Reputation points Microsoft Vendor
    2021-07-20T02:32:08.277+00:00

    Hi,

    The new.h lives in the SDK folder(e.g. C:\Program Files (x86)\Windows Kits\10\Include\10.x.x.x\ucrt).I suggest you should try to change "Windows SDK version" in project settings, and select the latest "10.x.x.x" version available from the drop-down list.

    Best Regards,

    Jeanine


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  4. Sahib Khan 0 Reputation points
    2024-04-05T13:04:23.7+00:00

    Make sure you have window sdk installed. Depends upon which windows you are on, on weindows 11 I had to Download 10.0.10240.0 from https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.