jsaxon2
asked on
Using c library in VC++ Project
I am trying to use a library written in c within a c++ program. I am getting an error:
c:\mad_test\msvc++\gui\pla yer.c(2021 ) : fatal error C1010: unexpected end of file while looking for precompiled header directive
I know that the error is being caused because it is a c file in a cpp program, but what I need to know is how do I make it work.
Thanks in advance,
John
c:\mad_test\msvc++\gui\pla
I know that the error is being caused because it is a c file in a cpp program, but what I need to know is how do I make it work.
Thanks in advance,
John
The error you posted is not related to the file been a *.c file.
The error has to do with your project precompile header options.
The error has to do with your project precompile header options.
ASKER
I get this error when I add #include "stdafx.h" to the top of the .c file:
c:\mad_test\msvc++\gui\pla yer.c(21) : fatal error C1853: 'Debug/GUI.pch' is not a precompiled header file created with this compiler
Error executing cl.exe.
c:\mad_test\msvc++\gui\pla
Error executing cl.exe.
Delete GUI.pch, and it should work.
ASKER
I deleteed the file and did a rebuild all and I still am getting the error. Anything else I could try?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked perfect. Thank you very much.
#include "stdafx.h"