[GCC-XML] /MD switch in msvc71. Any MFC patch?

László Blum laszlo.blum at blumsoft.com
Wed Sep 7 09:30:16 EDT 2005


Hi Brad,

Thanks you for your tip! It helped a lot!
I started to hack the MFC related includes according to your description.
Did I understand correctly that the task is to maintain the skeleton of the
code the MFC provides? Am I free to hack inside the bodies of the functions?
I want to make pyste work. I don't think it need any deeper analysation of
MFC classes... I just want pyste to generate wrapper code to my classes.
I will inform you how will I proceed.
Laszlo



-----Eredeti üzenet-----
Feladó: Brad King [mailto:brad.king at kitware.com]
Küldve: 2005. szeptember 6. 18:59
Címzett: László Blum
Másolatot kap: gccxml at gccxml.org
Tárgy: Re: [GCC-XML] /MD switch in msvc71. Any MFC patch?


László Blum wrote:
> Compiling my MFC application with gccxml I had to have the /MD
> (multithreaded DLL) flag with msvc71.
> How can I do it?
> The question sounds trivial and I tried it according to the doc.
> The GCCXML_CXXFLAGS=" /MD" or GCCXML_CXXFLAGS=" -MD" or
GCCXML_USER_FLAGS="
> /MD" has no effect.

The GCCXML_CXXFLAGS are passed to the native compiler when it is
executed to determine the set of preprocessor definitions it produces.
Unfortunately the VS compiler does not seem to have a way to report all
the preprocessor definitions in effect, so automatic determination does
not work.  For this compiler the set of definitions was determined by
hand by reading documentation and trial-and-error.  This means they do
not change with the flags.

> For GCCXML_USER_FLAGS=" -MD" it complains for an extra filename after the

These flags are passed to the GCC parser used internally by GCC-XML so
only valid GCC flags may be used.

You'll have to figure out what preprocessor macro definitions are
changed by /MD and add them to GCCXML_USER_FLAGS as "-D..." options.

> I need the _AFXDLL define that requires the above switch.
> I included the MFC include path by hand.
> I got a plenty of errors like this:
>
> C:/Program Files/Microsoft Visual Studio .NET
> 2003/Vc7/atlmfc/include/atlalloc.h
> :218: error: syntax
>    error before `...' token
[snip]
> I guess these are the parts I have to patch manually...
> Is there any patch for MFC files?

Many of the VS system headers get parse errors.  If you look near the
gccxml executable you will see a Vc71 subdirectory containing patched
copies of some headers.  This is where you need to place the fixed MFC
headers.  Alternatively you can place the fixed headers in any directory
(do not replace the original system header) and use the special
"-iwrapper" option in GCCXML_USER_FLAGS to specify the directory as a
place to look for "wrapper" headers.

-Brad




More information about the gccxml mailing list