afx.h... configure: error: Could not find the MFC includes

François Gouget fgouget at codeweavers.com
Thu Feb 22 23:30:16 CST 2001


Alex Wade wrote:
> 
> This is driving me nuts. I'm trying to compile an MFC application using
> WINE. I can specify the location of the ATL includes and configure is
> quite happy but it chokes when I give it the MFC includes in the same way:
> 
> ./configure --with-atl-includes=/home/wade/VC98/atl/Include
> --with-mfc-includes=/home/wade/VC98/mfc/Include
[...]
> The MFC, ATL stuff is all copied verbatim from an MSVC installation on
> another computer. (c:/program files/Visual Studio/VC98)
> 
> Any takers?

   Well, just copying the MFC headers from Visual C++ won't work.

   What configure does is try to compile a small program that just does
'#include <afx.h>'. If the compile succeeds then it found the right
directory, otherwise it didn't. But 'afx.h' will not compile out of the
box in Wine so configure will never 'find' it.
   To compile an MFC application with Wine you need to recompile the
MFC. One reason is getting the headers into a compilable form. Another
reason is that you need a '.so' library to link with. This means
modifying the sources so that they actually compile, and then link and
produce a 'libmfc.so'. The process has gotten a lot easier in the past 6
months but at last count it still represents over 4000 lines of unified
diff (after running winemaker on the MFC sources)...



lawson_whitney at juno.com wrote:
> 
> Dumb question:  did you run
> 
> winemaker --mfc
> 
> before trying ./configure?
> The default is --nomfc.

   If configure is looking for the ATL and the MFC it means it knows
that it is an MFC application. I bet Alex did not specify anything but
winemaker detected a file called 'stdafx.h' and automatically deducted
it was working on an MFC application.


-- 
François Gouget
fgouget at codeweavers.com



More information about the wine-users mailing list