|
-
May 29th, 1999, 02:25 AM
#1
Why this Error?
First I have a Project in vc60,it uses MFC,it works well,but later I add some .c or .h files (not use MFC) into the project,when compile,it's response:
-------------------Configuration: Search - Win32 Debug--------------------
Compiling...
En.c
d:\yj\httpsource\search\src\en.c(1) : fatal error C1853: 'Debug/Search.pch' is not a precompiled header file created with this compiler
head.c
d:\yj\httpsource\search\src\head.c(1) : fatal error C1853: 'Debug/Search.pch' is not a precompiled header file created with this compiler
Hz.c
d:\yj\httpsource\search\src\hz.c(1) : fatal error C1853: 'Debug/Search.pch' is not a precompiled header file created with this compiler
inverse.c
d:\yj\httpsource\search\src\inverse.c(1) : fatal error C1853: 'Debug/Search.pch' is not a precompiled header file created with this compiler
keytab.c
d:\yj\httpsource\search\src\keytab.c(1) : fatal error C1853: 'Debug/Search.pch' is not a precompiled header file created with this compiler
std.c
d:\yj\httpsource\search\src\std.c(1) : fatal error C1853: 'Debug/Search.pch' is not a precompiled header file created with this compiler
Generating Code...
Error executing cl.exe.
Search.exe - 6 error(s), 0 warning(s)
Why? How to solve?
Please Help me!
-
May 29th, 1999, 03:50 AM
#2
Re: Why this Error?
You must set a precompiled header file for these
*.c and *.h files,From the Project menu,select
"Setting",select"stdafx.h" as a precompiled file
for these *.h,*.c files.
-
May 29th, 1999, 05:26 AM
#3
Re: Why this Error?
just simply add
#include "stdafx.h"
for those files
-
March 5th, 2008, 07:54 AM
#4
Re: Why this Error?
The cause for your problem is this:
The compiler attempts to use a precompiled header generated by a C++ compiler on a C source file. This can happen when "Per-File Use of Precompiled Headers" is used with both C and C++ source code in a project.
It is not valid to use a C++ compiler created precompiled header with a source file that is to be compiled by the C compiler. Nor is it valid to use a C compiler created precompiled header with a source file that is to be compiled by the C++ compiler.
To solve it, please follow these steps:
1. For the current target, open the Project Settings dialog box and select the Precompiled Headers section under the C/C++ Tab.
2. Select each C file from the project tree in the left pane.
3. Select the Not using precompiled headers option button.
4. Save the new settings and build the project.
You can read further about this problem here:
http://support.microsoft.com/?scid=k...6717&x=14&y=16
Best regards,
Ricardo Vázquez.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|