Errors with typedefs in separate header
Here is a simple example where the latest version of gccxmlparser fail to create accessors to structure members with simple types declared in separate header:
------------ mytypes.h -------
#ifndef _MYTYPES_H_
#define _MYTYPES_H_
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
#endif
-------------- base.h -------
#include "mytypes.h"
#ifndef BASE_H_CONST
#define BASE_H_CONST
typedef struct
{
int INT;
uint32 U32;
uint8 U8[32];
uint16 U16;
} TST_STRUCT;
#endif
--------------- bind.py -------
#!/usr/bin/env python
import os
import sys
import subprocess
import pybindgen.
k_ModName = 'MyAPI'
k_api=['base.h']
def GenMY(path):
includes = ['"%s"'%h for h in k_api]
parser = pybindgen.
md = parser.parse(
k_api,
includes=
fname = os.path.
f=file(fname,'w');
md.generate(
f.close()
if __name__ == '__main__':
if len(sys.argv) != 2:
print "Need path to MX installation as an only argument"
sys.exit(1)
GenMY(
-------
Here is result of running of bind.py:
PYTHONPATH=
INFO Parsing source file "base.h" ...
INFO gccxml cmd: /usr/bin/gccxml -I"." "base.h" -fxml="
INFO GCCXML version - 0.9 BUGGY
/mango/
uint32 U32;
/mango/
uint8 U8[32];
/mango/
uint16 U16;
-------
The generated code only have gettter and setter functions for INT member of TST_STRUCT, but not for any others. What is going wrong here?
Thanks,
Vladimir
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- PyBindGen Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask vldmrrr for more information if necessary.