0

error C1010: unexpected end of file while looking for precompiled header. Did you forgot to add #include "stdafx.h" to your source file?

I have already added #include "stdafx.h" file in my .cpp file

#include "stdafx.h"

msmq()
{

   int a;

    enter code here

}

But when I used Squish coco for code instrumentation at that time they ignore this precompiler file and give me error.

I expect it to instrument my code successfully without giving C1010 error.

I already tried Precompiler Disable option, but it didn't work successfully

Ven
  • 19,015
  • 2
  • 41
  • 61
  • Coco usage is documented [here](https://doc.froglogic.com/squish-coco/latest/coveragescanner.html#cha%3Acommand-line-ref). Since it seems to invoke the C++ compiler, you'll have to reproduce the same compile options. Use Project > Properties > C/C++ > Command line to see them. Tells you to use /Yu"stdafx.h" – Hans Passant Sep 23 '19 at 08:33
  • @Hans Passant, already added in Command line. but it's not work – Mr.Bhavadip Gothadiya Sep 24 '19 at 08:35
  • I recommend contacting the vendor of Squish Coco for support. – frog.ca Sep 27 '19 at 06:53
  • Did you resolve this? I'm facing the same error and, actually, I'm hating squishcoco. – Cartucho Oct 21 '19 at 18:32
  • yes, because of some space error in header file. ensure that between (#include) and ("Header file name") must have only one space. #include "stdAfx.h" ( 2 space beween #include and Header file name) if you give only one space instead of more then one then simply solve it. – Mr.Bhavadip Gothadiya Nov 25 '19 at 06:50

1 Answers1

-1

Yes, because of some space error in the header file.

Ensure that between #include and "Header file name" there is only one space.

#include "stdAfx.h" (2 spaces between #include and header file name)

If you give only one space instead of more then one then simply solve it:

#include "stdAfx.h" (only one space) it's work correctly..

Simon Mattes
  • 4,866
  • 2
  • 33
  • 53