Cannot open precompiled headers

Gavin Williams 761 Reputation points

I made a Windows Desktop Application in C++, I have two projects and I'm getting errors

Cannot open precompiled header file: 'x64\Debug\BehaviourDemo.pch':No such file or directory.


And maybe related. It's unclear what template I should be using for modern desktop apps. I think this one had stdfx or something as the header. I think it was Windows Desktop Application. And my library was the static library - I then changed it to dynamic library. I just deleted all that code and replaced it. Is that an issue?

Edit: After posting this, it made me think that I should just redo the projects, so I used the DirectX Win32 project and the DLL project types instead. That may have fixed the issue.

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,626 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 43,041 Reputation points

    The VS2019 Windows Desktop Application template is not configured to use precompiled headers. I suggest that instead, you use the Windows Desktop Wizard.


    After clicking "Create" make the following selections -


    The wizard will then create a solution/project that is properly configured to use precompiled headers.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful