Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » MFA and Dev-C++

This thread is locked; no one can reply to it. rss feed Print
MFA and Dev-C++
ggoose
Member #1,402
July 2001

Edit: That should be MFC, not MFA!!!

Is there a way to use MFC with Dev-C++?
I get the error: " 'stdafx.h' no such file or directory" when trying to compile. Do I need to download an MFC library and if so, is there a free one? ;D

Zaphos
Member #1,468
August 2001

Well, I couldn't get it to work, but I suggest you take a shot all the same.

Do you have MSVC? If so, you can find all those .h files in the MSVC folders, although they're probably not even compatable with mingw32 as far as I can tell ... but you can add that whole directory to your includes under project options. 'course ... even that's not going to solve all of this.

If you don't have MFC, or haven't done anything with it yet, I suggest you check out wxWindows; that's a nice, open(?), pretty-sure-cross-platfor library that should be nicer to use, anyway.

gillius
Member #119
April 2000

You should get that error. stdafx.h is not a file that's provided by Windows or anyone. It is a file that YOU create.

stdafx.h is only just the default header file name for precompiled headers in MSVC. There's no reason there has to be a header called that, nor do you need to use precompiled headers (in mingw, you can't. OT: I wish GCC had precompiled headers -- although I hear work is being done on that).

Gillius
Gillius's Programming -- https://gillius.org/

Matt Smith
Member #783
November 2000

eh?

precompiled headers use the .pch filetype?

stdafx.h is the MFC header. you get the source for MFC with MSVC so I suppose you could compile a lib for mingw. You do not need to use the AppWizard to make an MFC program.

MFC without the AppWizard is just a C++ class library for the Win32 API. If you really just want a good class library then I recommend wxWindows too, as you can compile the same code f or Gtk+ in Linux.

Oscar Giner
Member #2,207
April 2002
avatar

stdafx.h is the header used to generate the precompiled headers. It has nothing to do with MFC. There's also stdafx.cpp, that just includes stdafx.h. This cpp file is compiled, and a pch file is generated.

Matt Smith
Member #783
November 2000

I have probably been confused by the fact that every C++ MSVC program I've seen has used MFC. You don't need stdafx.h to use precompiled headers with a C program.

My MFC book says that afxwin.h is part of MFC, but doesn't mention stdafx.h anywhere. I noticed stdafx.h appeared in any MFC application generated by the AppWizard.

Oscar Giner
Member #2,207
April 2002
avatar

afxwin.h is part of MFC.

You don't need stdafx.h for precompiled headers. You can use any header you want, but it's the default configuration provided by VC.

Go to: