MFC requires C++ compilation (use a .cpp suffix)/ C-files in a MFC-project?

  • Thread starter Thread starter WHats wrong
  • Start date Start date
W

WHats wrong

Guest
Hi!

I working with a MFC project in VS2010, the project compiling and the program is working.

Now I will try to add this project to a solution where we already have about 20 old c project. I do this because it belongs with that solution and I also want to use some functions in some of these c-files.

I have included the c-file (massivecfunctions.c ), with the functions I want to use, in my project with the /Tc flag only on that file(rest of my MFC project I have /Tp). When compiling with #include "stdafx.h" I getting this error:

Error 1 error C1189: #error : MFC requires C++ compilation (use a .cpp suffix) c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afx.h 15


When compiling without #include "stdafx.h" and "Not Using Precompiled Headers" on that file(rest of my MFC project I have Create (/Yc)). I get this error:

Error 4 error LNK2019: unresolved external symbol "int __cdecl getint(int)" (?getint@@YAHH@Z) referenced in function "protected: __thiscall CStartupThrd::CStartupThrd(void)" (??0CStartupThrd@@IAE@XZ) C:\StartupThrd.obj


Is it possible to use C-files in a MFC-project?


Regards

Whane

Continue reading...
 
Back
Top