3

Okay so I am writing something up in C++ and last night it was fine, I could compile perfectly w/o a problem. I saved all of my stuff and closed VS 2010 Ultimate. This morning when I went to go work on my stuff I tried recompiling and I got just over 200 errors, I couldn't figure out why so I noticed there were a few more warnings than usual and it says that it is skipping my headers.

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

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

Joshe343
  • 65
  • 1
  • 10

2 Answers2

5

Putting on my magic telepathic helmet, you problem is:

Your #include "myPrecompiledHeader.h" is not the first include in a file, when it should be.

AndyG
  • 39,700
  • 8
  • 109
  • 143
2

You have not posted more information, though the warning says it skipped #include<iostream> because preprocessor was expecting a precompiled header file. In case of your Visual C++ project that file normally is stdafx.h, try adding it as,

#include "stdafx.h"

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

Abdullah Leghari
  • 2,332
  • 3
  • 24
  • 40