C ++ - release of precompiled headers

Ok, so I'm writing something in C ++ and everything was fine last night, I could compile without issue. I saved all my stuff and closed VS 2010 Ultimate. This morning when I went to work on my stuff, I tried recompiling and I had just over 200 errors, I couldn't figure out why so I noticed that there were a few warnings than usual and it says it was missing my headers ...

Warning C4627: '#include <iostream>': skipped when looking for precompiled header use.

      

I tried to disable precompiled headers for my main .cpp, but when I compile it it just gives me even more errors. Is there a way to fix this?

+3


source to share


2 answers


Relying on your magical telepathic helmet, you are faced with the problem:



Yours is #include "myPrecompiledHeader.h"

not the first to be included in the file when it should be.

+5


source


You haven't posted more information yet, although the warning says it missed #include<iostream>

it because the preprocessor was expecting a pre-compiled header file. In case your Visual C ++ project is usually stdafx.h file, try adding it like,

#include "stdafx.h"

      



Add #include "stadfax.h" at the top of your cpp file, just above the other included directives.

+2


source







All Articles