[C++-sig] [Py++] Missing struct (was: [Py++] Generate Python code for ctypes?)

Nikolaus Rath Nikolaus at rath.org
Sun Dec 13 19:36:14 CET 2009


Roman Yakovenko <roman.yakovenko at gmail.com> writes:
>>> You can take a look on gmplib example:
>>> http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/examples/gmplib_dev/
>>> It is fully working.

There seems to be a problem with the generated code:

,----
| $ python
| Python 2.6.4 (r264:75706, Nov  2 2009, 14:38:03) 
| [GCC 4.4.1] on linux2
| Type "help", "copyright", "credits" or "license" for more information.
| >>> import generated
| Traceback (most recent call last):
|   File "<stdin>", line 1, in <module>
|   File "generated.py", line 227, in <module>
|     ("init", ctypes.POINTER( ctypes.CFUNCTYPE( None, ctypes.c_void_p, ctypes.POINTER( fuse_conn_info ) ) )),
| NameError: name 'fuse_conn_info' is not defined
`----

But struct fuse_conn_info is defined in fuse_common.h, which is included
in fuse_lowlevel.h, which is included in myheader.h, which has been used
to generate the code:

,----
| $ cat project_env.py
| import os
| import sys
| 
| lib = '/usr/lib/libfuse.so'
| 
| class gmp:
|     header_file = './myheader.h'
|     symbols_file = lib
|     shared_library_file = lib
|     generated_code_dir = 'generated'
`----

,----
| $ cat myheader.h 
| #define __builtin_va_arg_pack_len int
| #define _FILE_OFFSET_BITS 64
| #define FUSE_USE_VERSION 26
| #include <fuse/fuse_lowlevel.h>
`----

(the first define was necessary to prevent some gccxml errors).

Why is the fuse_file_info struct not translated into ctypes code?


Thanks,


   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C



More information about the Cplusplus-sig mailing list