A few of my header files have no includes, so I receive this message in Visual Studio 2010:
IntelliSense: PCH warning: cannot find a suitable header stop location. An intellisense PCH file was not generated.
If I add a single header, for instance:
#include <iostream>
It disappears. How can I stop this error from showing without adding (potentially unused) include>
When adding a .cpp file it inherits the PCH settings of the project. More detailed explanation of the problem here
Solutions:
#pragma once
at the start of the file.It will cause your source file to be included only once in a single compilation, therefore the compiler will be satisfied and won't require additional #include
Note! I'm including num 2, and 3 because some say it helped, but it only num 1 that did solve my case.
I suppose the problem is that you have precompiled header in your project (by default "stdafx.h") and to correctly solve the problem you should add
#include "stdafx.h"
at start of your header/source file.
Go to project's property and under C/C++ => Precompiled Headers, find the option "Precompiled header".
Change it to "Not Using Precompiled Headers".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With