[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Linking C files

Posted on 2002-05-07
4
Medium Priority
?
190 Views
Last Modified: 2013-11-20
I tried disabling the precompiled headers as advised but now I get the following fatal error in my C
files:
"MFC requires C++ compilation (use a .cpp suffix)"
Any idea how to solve this?
Thanks!
---------------------------------------------------------
Hi

I have a problem with linking my user application created using Microsoft Visual C++ version 6.0 to my files written in C.
I have included the "stdafx.h" file in my C source files but I still get the fatal error message saying the precompiled header file "Debug/projectname.pch" is not compatible with this version's precompiler. These error messages occur in my C files.
I tried deleting the pch file and recompiling but it still doesn't work.
Can someone advise on this?
Thanks!
0
Comment
Question by:kraa
  • 2
4 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 6993461
Hi kraa,

take a look at:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q126717

there your problem and possible solutions are described.

hope that helps,

ZOPPO
0
 

Author Comment

by:kraa
ID: 6993520
I tried disabling the precompiled headers as advised but now I get the following fatal error in my C files:
"MFC requires C++ compilation (use a .cpp suffix)"
Any idea how to solve this?
Thanks!
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 150 total points
ID: 6993582
You shouldn't include "stdafx.h" to your .c files ... the error comes from AFX.H
which is included from AFXWIN.H which is include from STDAFX.H ... this AFX.H
declares a lot of common classes (i.e. CString) which of course cannot be compiled
by a C-compiler.
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 6994622
2 kraa
Let's try rename your *.c files to *.cpp.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question