IntelliSense PCH Warning not going away
Asked Answered
W

2

5

I have a ATL C++ project and I don't have any includes in one of my C++ source files.

When I try to compile, I am receiving a PCH warning:

Error (active) E2940 PCH warning: an unknown error occurred. An IntelliSense PCH file was not generated.

But the project compiles fine alongside with this warning.

I tried adding #pragma once and include "stdafx.h" as mentioned in this post, but any of them did not resolve this issue.

What else can I do to resolve this issue?

Winkle answered 14/8, 2017 at 6:18 Comment(4)
Usually this happens when you don't follow implicit Microsoft's conventions for organizing your project. You don't put external includes such as <vector> to your stdafx.h, for instance.Devisable
@MinorThreat unloading solution and reloading worked for mine!Winkle
I've had this problem when my stdafx.h was almost empty&abandoned and standard libraries were included in traditional C++ way.Devisable
@MinorThreat Thanks for help! As you say mine also is almost empty.Winkle
W
7

As mentioned in this answer, closing and re-opening the solution worked fine for me.

Winkle answered 14/8, 2017 at 6:28 Comment(1)
Hi GTAVLover, glad to hear that your issue is solved and please mark your reply as answer when you have free time :) , it will help other community members to easier search this information.Yeisk
B
0

In my experience, I just had an error in the program with std so I started using namespace std and it worked. I also added #pragma once

Bicarb answered 10/8, 2018 at 9:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.