[C++-sig] Pyste with MPL (well, Boost.Serialize, actually...)

Drumheller, Michael michael.drumheller at boeing.com
Wed Jan 4 19:55:53 CET 2006


I am having trouble running Pyste version 0.9.30 (gccxml version 0.6.0)
with Boost MPL 1.32 on Windows XP.  A complete (and trivial) example
that demonstrates the problem is included below

The problem has to do with the #ifdef's based on _MSC_VER that appear in
files such as or.hpp, and.hpp, etc.  It seems that _MSC_VER *is*
defined, but does anyone know why that should be?  After all, it is
GCCXML that is being run, not the VC7 compiler.   I found this page
which is probably address similar problems, but has no fixes that I can
discern.
<<http://mail.python.org/pipermail/c++-sig/2005-August.txt>>

Note:  This actually came up because I was trying to run Pyste on a file
that contained classes that use Boost.Serialization to serialize
themselvs, and Boost.Serialization uses MPL a lot.  I noticed that the
first signs of problems stem from the MPL headers, as in my example
below, and I am _hoping_ that once I fix this Boost.Serialization will
just work.
Has anyone else had success running Pyste on Boost.Serialize'd classes?

Thank you.

Michael Drumheller

Example:
-------------------------MplTest.pyste-------------------------
Class("MplTest",  "MplTest.h")
-------------------------MplTest.h-------------------------------
#include <boost/mpl/or.hpp>
class MplTest {};
-------------------------pyste command and output-----------------------
mpltest.deleteme=> c:/Python24/python.exe
c:/Python24/Lib/site-packages/Pyste/pyste.py
-Ic:/Boost/include/boost-1_32 MplTest.pyste 
In file included from MplTest.h:1:
c:/Boost/include/boost-1_32/boost/mpl/or.hpp:33:13: operator "defined"
requires an identifier
c:/Boost/include/boost-1_32/boost/mpl/or.hpp:33:13: ("or" is an
alternative token for "||" in C++)
c:/Boost/include/boost-1_32/boost/mpl/or.hpp:33:15: missing '(' in
expression
c:/Boost/include/boost-1_32/boost/mpl/or.hpp:44:13: operator "defined"
requires an identifier
c:/Boost/include/boost-1_32/boost/mpl/or.hpp:44:13: ("or" is an
alternative token for "||" in C++)
c:/Boost/include/boost-1_32/boost/mpl/or.hpp:44:15: missing '(' in
expression
Traceback (most recent call last):
  File "c:/Python24/Lib/site-packages/Pyste/pyste.py", line 424, in ?
    main()
  File "c:/Python24/Lib/site-packages/Pyste/pyste.py", line 418, in main
    status = Begin()
  File "c:/Python24/Lib/site-packages/Pyste/pyste.py", line 257, in
Begin
    return GenerateCode(parser, module, out, interfaces, multiple)
  File "c:/Python24/Lib/site-packages/Pyste/pyste.py", line 376, in
GenerateCode
    declarations, parsed_header = parser.Parse(header, interface, tail)
  File "c:\Python24\Lib\site-packages\Pyste\CppParser.py", line 165, in
Parse
    declarations = self.ParseWithGCCXML(header, tail)
  File "c:\Python24\Lib\site-packages\Pyste\CppParser.py", line 126, in
ParseWithGCCXML
    raise CppParserError, 'Error executing gccxml'
CppParser.CppParserError: Error executing gccxml
mpltest.deleteme=>





More information about the Cplusplus-sig mailing list