0

I'm working on a project in C++ on Visual Studio 2017. I have a cpp file and adequate header file that perform some functionality I need in my project, which someone wrote some time ago.

The problem is that this code is in C and my project is a C++ project. I tried to "translate" it into C++, but since I don't fully understand the code I'm having trouble doing so.

I thought perhaps a faster way would be to use the C files as thery are in my project. when I try to build it I get the following error:

Error   C1010   unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?    c:\users\pathName\file.c    124 

I'm not sure how to tell the compiler not to look for "stdafx.h" since it's a C file. Is it possible to do so or do I have to "translate" the files to C++?

Thank you

user14092875
  • 145
  • 1
  • 1
  • 12
  • 1
    Please just search for that error message online. – Ulrich Eckhardt Oct 08 '20 at 06:32
  • 1
    You can change the properties for that file in your project settings and tell the compiler not to use precompiled headers. – paddy Oct 08 '20 at 06:32
  • Thank you everyone for your help. i mistakenly searched the wrong line and that's why I couldn't find the solution, I just saw the solution in the other post and it worked. Do I need to close the post or mark it as solved? – user14092875 Oct 08 '20 at 06:36
  • No need to do anything. It has been marked as a duplicate. – paddy Oct 08 '20 at 06:39

0 Answers0