First of all, congratulations, py++ is an excellent package. It generates brilliant code, much much better than pyste. I have got very good experience with it, generating code even for relatively big projects.
I only got one problem. When creating the module builder and including several specific files it raises an exception. I have followed the advice on big projects and I include all headers in one header.
The whole output:
INFO Parsing source file "Core/Core.h" ...
INFO gccxml cmd: /usr/bin/gccxml -I"../../../" -I"../../../" "../../../Core/Core.h" -fxml="/tmp/tmpI0w7iY.xml"
Traceback (most recent call last):
File "generate_bindings.py", line 10, in ?
mb = module_builder.module_builder_t( working_directory = "../../../", files = source_files, include_paths = [ "../../../" ], indexing_suite_version = 2 )
File "/usr/lib64/python2.4/site-packages/pyplusplus/module_builder/builder.py", line 87, in __init__
File "/usr/lib64/python2.4/site-packages/pyplusplus/module_builder/builder.py", line 118, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/usr/lib64/python2.4/site-packages/pygccxml/parser/project_reader.py", line 225, in read_files
File "/usr/lib64/python2.4/site-packages/pygccxml/parser/project_reader.py", line 250, in __parse_file_by_file
decls = reader.read_file( header )
File "/usr/lib64/python2.4/site-packages/pygccxml/parser/source_reader.py", line 244, in read_file
AttributeError: 'typedef_t' object has no attribute 'has_value_name'
This only happens when I include 3 files in the project (every other header file works without any problems). Strange is, that I have some very neat C++ metaprogramming inside the project, but that is parsed (and even exposed when instantiated) properly. This error only happens on 3 (IMO very simple headers). Their names are Log.h, LogSystem.h and RegularExpressions.h. Even when I include them separately they raise the exception.
RegularExpressions.h is the simplest one (it only typedefs to boost::regex).
// not really needed there, but if user wants regular expression, he/she definitely wants the string too
typedef boost::regex Regex;
# define RegexMatch boost::regex_match
Global.h just prototypes the classes (to lower depencies), and String.h just typedefs String to std::string. But String.h header is used everywhere and works flawlessly when used from any other header file.
Thanks in advance,
Log in to post a comment.