<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.2.1">
</HEAD>
<BODY>
Hi All,<BR>
<BR>
First, thanks to all for the excellent work on Wine.&nbsp; I'm a Crossover Office user, and I anxiously await each week's Wine Weekly Newsletter as well to keep myself up with happenings in the Wine world.&nbsp; You guys truly rock.<BR>
<BR>
But I digress.&nbsp; Here's the real reason for my e-mail:<BR>
<BR>
I need to port one of my company's MFC-based application to Linux.&nbsp; My first thought was to use Winelib.<BR>
<BR>
I understand from everything that I've read that I need to recompile MFC using Wine.&nbsp; Easier said than done, though.&nbsp; I've spent several hours just trying to get everything setup correctly, and things are still not compiling correctly.<BR>
<BR>
First, some questions:<BR>
- My initial attempt at compiling MFC was on the MFC source code from VS.NET 2003.&nbsp; After not being able to get a satisfactory Makefile configuration for compling that version of MFC, I figured that perhaps VS98's version of MFC was more commonly recompiled by Wine developers, so I'm currently trying to compile VC98's MFC.&nbsp; Is there a preferred version of MFC that I should be compiling, or are they all equally difficult?&nbsp; ;-)<BR>
- I have the following RPM packages installed on my Mandrake 10.1 OS:&nbsp; libwine1-20040813-2mdk, winelib-0.3-1mdk, libwine1-devel-20040813-2mdk, wine-20040813-2mdk.&nbsp; I have also downloaded the latest wine source code from 20050111.&nbsp; As mentioned before, I also have Crossover Office installed.&nbsp; In your opinion, is there a more compatible or better set of libraries to use when compiling?&nbsp; Anybody compiled MFC using the Mandrake packages before?&nbsp; (FYI, wineg++ --version and winegcc --version both report that they are g++/gcc (GCC) 3.4.1.<BR>
- Also, should I be using an older version of Wine's source code, instead of the very recent 20050111 version that I've currently got on my system?<BR>
<BR>
I've read the Winelib documentation on compiling MFC and have combed through the mailing list archives as much as possible to get to where I'm currently at.&nbsp; After running winemaker on the VC98 source code directories and tweaking the resulting VC98/MFC/src/Makefile quite a bit, I also put the following #defines at the top of VC98/MFC/src/stdafx.h:<BR>
<BR>
#define _AFX_PORTABLE<BR>
#define _FORCENAMELESSUNION<BR>
#define _AFX_NO_DAO_SUPPORT<BR>
#define _AFX_NO_DHTML_SUPPORT<BR>
#define _AFX_NO_OLEDB_SUPPORT<BR>
#define _AFX_NO_RICHEDIT_SUPPORT<BR>
#define _AFX_NO_ATL_SUPPORT<BR>
<BR>
(That seems to be basically what the Winelib docs tell me to do.)<BR>
<BR>
Anyway, here's the current output when I run 'make -f Makefile' in the VC98/MFC/src directory:<BR>
<BR>
wineg++ -c&nbsp; -mno-cygwin -isystem -fpermissive -fms-extensions -fshort-wchar -DWINE_UNICODE_NATIVE -DICOM_USE_COM_INTERFACE_ATTRIBUTE -I. -I/home/ajboyle/wine-20050111/include/msvcrt -I/home/ajboyle/wine-20050111/include -I../Include&nbsp;&nbsp;&nbsp; -o afxabort.o afxabort.cpp<BR>
In file included from stdafx.h:96,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from afxabort.cpp:11:<BR>
../Include/afxcom_.h: In constructor `CIP&lt;_Interface, _IID&gt;::CIP(IUnknown*)':<BR>
../Include/afxcom_.h:357: error: there are no arguments to `GetIID' that depend on a template parameter, so a declaration of `GetIID' must be available<BR>
../Include/afxcom_.h:357: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)<BR>
../Include/afxcom_.h: In member function `CIP&lt;_Interface, _IID&gt;&amp; CIP&lt;_Interface, _IID&gt;::operator=(IUnknown*)':<BR>
../Include/afxcom_.h:379: error: there are no arguments to `QueryInterface' that depend on a template parameter, so a declaration of `QueryInterface' must be available<BR>
../Include/afxcom_.h: At global scope:<BR>
../Include/afxcom_.h:403: error: an explicit specialization must be preceded by 'template &lt;&gt;'<BR>
In file included from stdafx.h:110,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from afxabort.cpp:11:<BR>
../Include/afxctl.h: In constructor `COleControl::XEventConnPt::XEventConnPt()':<BR>
../Include/afxctl.h:1303: warning: invalid access to non-static data member `COleControl::m_xEventConnPt' of NULL object<BR>
../Include/afxctl.h:1303: warning: (perhaps the `offsetof' macro was used incorrectly)<BR>
../Include/afxctl.h: In constructor `COleControl::XPropConnPt::XPropConnPt()':<BR>
../Include/afxctl.h:1310: warning: invalid access to non-static data member `COleControl::m_xPropConnPt' of NULL object<BR>
../Include/afxctl.h:1310: warning: (perhaps the `offsetof' macro was used incorrectly)<BR>
In file included from ../Include/afxpriv.h:758,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from stdafx.h:123,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from afxabort.cpp:11:<BR>
../Include/afxconv.h:62:21: atlconv.h: No such file or directory<BR>
In file included from stdafx.h:127,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from afxabort.cpp:11:<BR>
oleimpl2.h: At global scope:<BR>
oleimpl2.h:94: error: a class-key must be used when declaring a friend<BR>
In file included from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/backward/new.h:33,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from stdafx.h:161,<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from afxabort.cpp:11:<BR>
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;iostream&gt; instead of the deprecated header &lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.<BR>
winegcc: g++ failed.<BR>
make: *** [afxabort.o] Error 2<BR>
<BR>
Funny how gcc is telling me to use -fpermissive, when I'm already using it.&nbsp; Anyway, that's probably a red herring.<BR>
<BR>
If I can gain a clear understanding of the current steps needed to successfully compile MFC, I'd be more than happy to contribute updated 'Compiling MFC' docs to the Winelib docs to help out future developers that may be in a similar predicament as me.<BR>
<BR>
Thanks in advance for any help you can give me.<BR>
<BR>
Adam Boyle
</BODY>
</HTML>