ModuleParserWarning Class ignored base class not declared
Hi All,
I am using pybindgen (0.1.6) to wrap a project called libgdf (sourceforge.
Class Writer inherits from class RecordFullHandler, and for some reason the pybindgen ModuleParser reports the following error
C:\libgdf\
Haven't used c++ in a while, so I am trying to figure out what to investigate next. Could this be a problem of circular header inclusion? Code of the two header files is below. It may help to know that Writer.c compiles successfully in MSVC++.
The header code is followed by the exact pybindgen error. I've been playing around trying to solve this with forward declarations (class foo; in place of #include foo.h) or re-ordering the includes, no progress with that approach yet.
Writer.h
#ifndef __WRITER_
#define __WRITER_
#include "GDF/RecordFull
#include "GDF/GDFHeaderA
#include "GDF/RecordBuff
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
namespace gdf
{
enum WriterFlags
{
};
class Writer : public RecordFullHandler
{
public:
/// Constructor
Writer( );
/// pages of code removed to make the question readable
};
}
#endif // __WRITER_
RecordFullHandl
#ifndef __RECORDFULLHAN
#define __RECORDFULLHAN
#include "GDF/Record.h"
namespace gdf
{
class RecordFullHandler
{
public:
/// Constructor
/// Destructor
virtual ~RecordFullHandler( );
virtual void triggerRecordFull( Record *rec );
};
}
#endif
The wrapping command is
C:\libgdf\build> python module-autogen.py "C:\libgdf\
A detail of module-autogen.py is
gccxml_options = {'include_paths':
The output is
C:\Python26\
INFO Parsing source file "C:\libgdf\
INFO gccxml cmd: ""C:\Program Files (x86)\gccxml 0.9\bin\gccxml.exe" -I"." -I"C:\libgdf\
INFO GCCXML version - 0.9
C:\Python26\
warnings.warn( msg )
C:\libgdf\
{
I appreciate your suggestions.
Regards,
Owen
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- PyBindGen Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Owen Kelly
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
To be honest, I don't know what is wrong. The header files seem OK.
It may help to uncomment some of the debug print statements inside pybindgen/
What about the whilelist_paths option? Check the documentation:
:param whitelist_paths: additional directories for definitions to be included
Normally the module parser filters out API definitions that
have been defined outside one of the header files indicated
for parsing. The parameter whitelist_paths instructs the
module parser to accept definitions defined in another
header file if such header file is inside one of the
:type whitelist_paths: list of string
So, in your case, remember you need the option whitelist_
Revision history for this message
|
#2 |
Adding the white_list had the effect of generating many more errors, and now modules that used to build, no longer build.
I assume that means the previous success might have been an illusion and if I had tried to use those modules, I would have uncovered missing functionality.
Would you interpret the following parse log for Writer.h to mean that 'std' needs to be added to the white_list some how?
C:\Python26\
import md5
INFO Parsing source file "C:\Users\
INFO gccxml cmd: ""C:\Program Files (x86)\gccxml 0.9\bin\gccxml.exe" -I"." -I"C:\Users\
INFO GCCXML version - 0.9
C:\Python26\
warnings.warn( msg )
>>> looking at class gdf::Channel [class]
>>> looking at class gdf::ChannelDat
>>> looking at class gdf::EventHeader [class]
>>> looking at class gdf::GDFHeaderA
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> class gdf::HeaderArra
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> class gdf::HeaderItem
>>> looking at class gdf::HeaderItemBase [struct]
>>> looking at class gdf::HeaderRef [struct]
>>> looking at class gdf::MainHeader [class]
>>> looking at class gdf::Mode1Event [struct]
>>> looking at class gdf::Mode3Event [struct]
>>> looking at class gdf::Mode3Event [union]
>>> looking at class gdf::Record [class]
>>> looking at class gdf::RecordBuffer [class]
>>> looking at class gdf::RecordFull
>>> looking at class gdf::SignalHeader [class]
>>> looking at class gdf::TagHeader [class]
>>> looking at class gdf::Writer [class]
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderArra
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::HeaderItem
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
>>> looking at class gdf::exception:
C:/Users/
{
C:/Users/
uint32 getTypeID( );
C:/Users/
virtual void addSample( const int8 ) { throw exception:
C:/Users/
virtual void addSample( const uint8 ) { throw exception:
C:/Users/
virtual void addSample( const int16 ) { throw exception:
C:/Users/
virtual void addSample( const uint16 ) { throw exception:
C:/Users/
virtual void addSample( const int32 ) { throw exception:
C:/Users/
virtual void addSample( const uint32 ) { throw exception:
C:/Users/
virtual void addSample( const int64 ) { throw exception:
C:/Users/
virtual void addSample( const uint64 ) { throw exception:
C:\Python26\
DeprecationWa
C:/Users/
virtual void blitSamples( const int8*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const uint8*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const int16*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const uint16*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const int32*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const uint32*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const int64*, const size_t ) { throw exception:
C:/Users/
virtual void blitSamples( const uint64*, const size_t ) { throw exception:
C:/Users/
virtual void fill( const int8, const size_t ) { throw exception:
C:/Users/
virtual void fill( const uint8, const size_t ) { throw exception:
C:/Users/
virtual void fill( const int16, const size_t ) { throw exception:
C:/Users/
virtual void fill( const uint16, const size_t ) { throw exception:
C:/Users/
virtual void fill( const int32, const size_t ) { throw exception:
C:/Users/
virtual void fill( const uint32, const size_t ) { throw exception:
C:/Users/
virtual void fill( const int64, const size_t ) { throw exception:
C:/Users/
virtual void fill( const uint64, const size_t ) { throw exception:
C:/Users/
virtual void fromstream( std::istream &in ) = 0;
C:/Users/
virtual int8 getSample( size_t, int8 /*dummy*/ ) { throw exception:
C:/Users/
virtual uint8 getSample( size_t, uint8 /*dummy*/ ) { throw exception:
C:/Users/
virtual int16 getSample( size_t, int16 /*dummy*/ ) { throw exception:
C:/Users/
virtual uint16 getSample( size_t, uint16 /*dummy*/ ) { throw exception:
C:/Users/
virtual int32 getSample( size_t, int32 /*dummy*/ ) { throw exception:
C:/Users/
virtual uint32 getSample( size_t, uint32 /*dummy*/ ) { throw exception:
C:/Users/
virtual int64 getSample( size_t, int64 /*dummy*/ ) { throw exception:
C:/Users/
virtual uint64 getSample( size_t, uint64 /*dummy*/ ) { throw exception:
C:/Users/
virtual void setSample( size_t, int8 ) { throw exception:
C:/Users/
virtual void setSample( size_t, uint8 ) { throw exception:
C:/Users/
virtual void setSample( size_t, int16 ) { throw exception:
C:/Users/
virtual void setSample( size_t, uint16 ) { throw exception:
C:/Users/
virtual void setSample( size_t, int32 ) { throw exception:
C:/Users/
virtual void setSample( size_t, uint32 ) { throw exception:
C:/Users/
virtual void setSample( size_t, int64 ) { throw exception:
C:/Users/
virtual void setSample( size_t, uint64 ) { throw exception:
C:/Users/
virtual void tostream( std::ostream &out ) = 0;
C:/Users/
void fromStream( std::istream &stream );
C:/Users/
void getEvent( uint32 index, Mode1Event &ev );
C:/Users/
void getEvent( uint32 index, Mode3Event &ev );
C:/Users/
uint8 getMode( ) { return m_mode; }
C:/Users/
uint32 getNumEvents( );
C:/Users/
void setMode( uint8 mode );
C:/Users/
void toStream( std::ostream &stream );
C:/Users/
void setRecordDuration( uint32 num, uint32 den );
C:/Users/
void setRecordDuration( uint32 num, uint32 den );
C:/Users/
virtual void tostream( std::ostream &out ) const = 0;
C:/Users/
HeaderRef( std::string n="", void *r = NULL, size_t o = 0, size_t l = 0) : name(n), ref(r), ofs(o), len(l) { }
C:/Users/
void *ref;
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
uint32 position;
C:/Users/
uint16 type;
C:/Users/
uint32 duration;
C:/Users/
uint16 channel;
C:/Users/
uint32 position;
C:/Users/
uint16 type;
C:/Users/
void operator=( const Record &other );
C:/Users/
Channel *getChannel( const size_t chan_idx );
C:/Users/
Record *acquireRecord( );
C:/Users/
void addRecord( Record *r );
C:/Users/
std::list< Record* >::iterator createNewRecord( );
C:/Users/
Record *getFirstFullRe
C:/Users/
Channel *getValidChannel( const size_t channel_idx );
C:/Users/
void registerRecordF
C:/Users/
void unregisterRecor
C:/Users/
virtual void triggerRecordFull( Record *rec );
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
uint32 get_samplerate( ) const { return samplerate; }
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
GDF_DECLARE_
C:/Users/
void set_samplerate( uint32 fs ) { samplerate = fs; }
C:\Users\
Record *acquireRecord( );
C:\Users\
void addEvent( uint32 position, uint16 type );
C:\Users\
void addEvent( uint32 position, uint16 type );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, uint32 duration );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, uint32 duration );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, uint32 duration );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, uint32 duration );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, float32 value );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, float32 value );
C:\Users\
void addEvent( uint32 position, uint16 type, uint16 channel, float32 value );
C:\Users\
void addRecord( Record *r );
C:\Users\
void setEventMode( uint8 mode );
C:\Users\
virtual void triggerRecordFull( Record *rec );
C:\Users\
void writeRecordDirect( Record *r );
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
T &operator[]( size_t idx ) { return item[idx]; }
C:/Users/
const T &operator[]( size_t idx ) const { return item[idx]; }
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
T item[L];
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
void fromstream( std::istream &in ) { in.read( reinterpret_
C:/Users/
void tostream( std::ostream & out ) const { out.write( reinterpret_
C:/Users/
size_t datatype_size( uint32 t );
C:/Users/
{
C:/Users/
{
Revision history for this message
|
#3 |
And a big thank you for the first response!
Owen
Revision history for this message
|
#4 |
Thank you for the DEBUG tip, I was able to identify a missing directory in the include_paths.
Unclear if I need to use the white_paths; when I do so, the error logs increase from 50k to 1MB to parse a small file.
For now I will change focus to resolve some of many TypeLookupError's.
What is the implication of a TypeLookupError such this?:
C:\libgdf\
Does in mean that function get_datatype was not wrapped?
Should I conclude that the header containing definition for 'gdf::uint32 &' was not parsed? or that this missing type needs to be manually added to some global dictionary?
Thanks,
Owen
Revision history for this message
|
#5 |
Well, whitelisting the std includes is probably going to push pybindgen to its limits and cause more problems than it's worth. Trying to wrap the entire stdlib is not a good idea. I would probably try to add the definitions of the needed exception base classes to a private header file, which includes your main header file, and scan that file instead.
Yes, the gdf::uint32 is not being picked up, it must be defined in some header file not whitelisted. Perhaps it's easier to just copy the definition to the private header file I mentioned above.
Note that an item in whitelist_paths can be also a specific file name, not just a directory name.
Revision history for this message
|
#6 |
Thank you for that advice.
I'm struggling to understand the distinction between white_lists and include_paths.
How do you choose when one or other is required for a given header file?
I think the answer may help the two issues I am facing.
Issue 1: lots of TypeLookupError's =======
What should I conclude from these three facts?:
1. TypeLookupError indicates the definition of gdf::uint32 is not known to PBG.
2. gdf::uint32 is defined in Types.h.
3. There is a signature "gdf::uint32 const & gdf::SignalHead
Does this mean Types.h should be added to white_lists or added to include_paths?
Issue 2: base class not declared =======
If class A: public B {}; fails because "base class not declared", does that mean B.h should be added to white_lists or added to include_paths?
Thanks and Regards,
Owen
Revision history for this message
|
#7 |
OK, I understand it can be confusing, but I try to explain the difference. include_paths are the -I include directives given to the compiler, in this case gccxml. Now, gccxml will scan header files and report lots of definitions, some of which are not even part of the library you want to parse, could be from stdlib itself. After gccxml finishes running, pybindgen does it's job poccessing the definitions found, and then it uses whitelist_paths to select for binding just some of the definitions found.
Figure: https:/
In order to bind a library, the header must be compilable by gccxml, which means include_paths must include all header folders. However, pybindgen can cope with missing definitions --- it just ignores classes that are referenced but not defined --- so whitelist_paths may include just a subset of header files.
1) Types.h should be added the whitelist_paths
2) B.h should be added to whitelist_paths.
If gccxml is able to scan the headers (if not you get a fatal exception), there is no need to mess with include_paths, it is already correct.
Revision history for this message
|
#8 |
That is very helpful.
By being part of whitelist_paths, does PBG try to wrap all of B.h, or only the part of B.h that A.h requires?
I.e. How to tell PBG that A.h is the "real target" and B.h is only there to assist in wrapping A.h?
Revision history for this message
|
#9 |
Sorry, that is not really possible at the moment :-/ PBG wraps everything in B.h. It actually sounds like a good idea for development of PBG, if only I had more time...
With some manual work, it is possible to ask PBG to ignore certain definitions. To do this, you can use the pre_scan_hook, there's an example in ns-3:
http://
Revision history for this message
|
#10 |
I am making a lot of progress now. I am tweaking white_paths until errors disappear. Appreciating very much your help.
But I have run into an error TypeLookupError
Other times, when I had TypeLookupError
Here is the full error...
>>> looking at class std::range_error [class]
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/
__CLR_
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/
__CLR_
C:\Python26\
DeprecationWa
Revision history for this message
|
#11 |
I am still hunting for an explanation or workaround for TypeLookupError
With logging active in typehandlers/
TypeMatcher.
try to lookup type handler for 'char const * const &' => failure
C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/
__CLR_
Revision history for this message
|
#12 |
The low level error is TypeLookupError
Presumably others have wrapped std::exception before. So either
1. I am taking the wrong approach by expecting ModuleParser to wrap exceptions, or
2. the exception signatures in my MSVC++ 8.0 environment are not recognized by PBG type system, or
3. the way that my project uses the standard exceptions is not recognized by ModuleParser
I think https:/
I am unclear how one uses add_exception and ModuleParser.
Re 3, my project has custom exceptions defined in Exceptions.h, and an example of how throw is used appears below in an excerpt of Channel.h.
Thanks for any suggestions.
----------------- Exceptions.h -----------------
#ifndef __EXCEPTIONS_
#define __EXCEPTIONS_
#include <exception>
#include <stdexcept>
#include <list>
#include <string>
#include <sstream>
namespace gdf {
namespace exception
{
/// A general exception
class general : public std::exception
{
public:
virtual ~general( ) throw() { }
const char *what( ) const throw() { return msg.c_str(); }
private:
};
/// An index exceeds it's valid range.
class index_out_of_range : public std::range_error
{
public:
};
// other exceptions omitted for brevity
}
}
#endif
-------- Channel.h ----------------- excerpt showing how throw is used
template<
{
using boost::
switch( m_signalheader-
{
case INT8: m_data->addSample( numeric_
case UINT8: m_data->addSample( numeric_
case INT16: m_data->addSample( numeric_
case UINT16: m_data->addSample( numeric_
case INT32: m_data->addSample( numeric_
case UINT32: m_data->addSample( numeric_
case INT64: m_data->addSample( numeric_
case UINT64: m_data->addSample( numeric_
case FLOAT32: m_data->addSample( numeric_
case FLOAT64: m_data->addSample( numeric_
default: throw exception:
//default: throw exception:
};
}
-------
Revision history for this message
|
#13 |
Regarding "char * &", no, this type is just not wrapped. I think PBG wraps char * and char &, not the combination of * and &. I guess it's impossible to wrap every type under the sun, and this is a weird combination I've never seen before.
PBG ModuleParser needs to be told a class is an exception class through annotation (see tests/foo.h for example, search for exception). On the other hand, ModuleParser may fail to wrap an exception if the base class is not wrapped, such as std::exception base class. In this case, it might be easier to write this exception part manually, as in the linked question.
Revision history for this message
|
#14 |
Thanks. Based on that info I have been playing with tests/foo.h .
The good news:
foo.h covers many of the examples that I am interested in.
In particular, I noticed that the add_exception routine generated some code that issues a type alias for 'char * &'.
The other news:
I am experiencing a minor error in waf check that prevents running the tests.
File "C:\Python26\
ensure_dir_exists
raise RuntimeError( '%s("%s") does not exist!' % ( meaning, dir_path ) )
RuntimeError: include directory("") does not exist!
It seems like a simple enough error checking issue when include directory is empty, but I'm not sure how to fix it because I am also learning waf and struggling to get waf running in my python debugger so that I can step through the waf script.
Fix 1: Change include paths to be non-empty somehow in the environment. Which environment variable?
Fix 2: Change include paths to be non-empty somewhere in the waf-script. Where in the waf script? Struggling to step through waf script.
Fix 3: Change the error checking so that it passes in the case of include paths = [], without knowing the consequences of suppressing that condition, and again without waf script running in debugger.
I appreciate any suggestion the forum might have. Now I go to learn more about waf.
Regards,
Owen
------------ detailed trace -------
C:\libgdf\
GCCXML="C:\Program Files (x86)\gccxml 0.9\bin\gccxml.exe"
CXXFLAGS=/EHsc
INCLUDE=c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
LIB=c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\
LIBPATH=
C:\libgdf\
[ 6/25] cxxshlib: build\tests\
ests\foo.pyd build\tests\
Creating library tests\foo.lib and object tests\foo.exp
[ 7/25] command (${PYTHON}): tests\foomodule
ts\foomodule2.cc build\tests\
C:\Python26\
onWarning: the md5 module is deprecated; use hashlib instead
import md5
PYTHON_INCLUDES: "['c:\\\\Program Files (x86)\\\\Microsoft Visual Studio 9.0\\\\
VC\\\\INCLUDE', 'C:\\\\Program Files\\\\Microsoft SDKs\\\
clude', '', 'c:\\\\Program Files (x86)\\\\Microsoft Visual Studio 9.0\\\\VC\\\\I
NCLUDE', 'C:\\\\Program Files\\\\Microsoft SDKs\\\
'C:\\\
Traceback (most recent call last):
File "tests\
main()
File "tests\
my_module_gen()
File "tests\
gccxml_
File "C:\Users\
gccxmlparser.py", line 683, in parse_init
self.
File "C:\Python26\
parse
answer = parser.
File "C:\Python26\
25, in read_files
return self.__
File "C:\Python26\
46, in __parse_
, self.__decl_factory )
File "C:\Python26\
, in __init__
self.
File "C:\Python26\
aise_on_
super( gccxml_
File "C:\Python26\
aise_on_
, self.include_paths )
File "C:\Python26\
lambda>
map( lambda idir: self.__
File "C:\Python26\
ensure_dir_exists
raise RuntimeError( '%s("%s") does not exist!' % ( meaning, dir_path ) )
RuntimeError: include directory("") does not exist!
Waf: Leaving directory `C:\Users\
.16.0\build'
Build failed
-> task in 'foomodule2.cc foomodulegen_
{task 42818160: command_task foomodulegen-
,foomodulegen_
''
Revision history for this message
|
#15 |
I am having some success following the example of tests/foo.h, will report back.
Revision history for this message
|
#16 |
Sorry, I do not test regularly on MSVC, as Linux is my only development platform; I am not surprised the unit tests do not run.
Revision history for this message
|
#17 |
Summary:
The initial problem was errors of the form "base class ... not declared":
C:\libgdf\
{
even though the code of the input header file has #include "GDF/RecordFull
I found two causes that should be investigated if you see this error:
1) Include paths are incorrect. So although the include statement is there, gccxml can't find the file.
2) The file is included, but contains some kind of error or other dependency that kills the definition of the base class.
Having said that, I continue to experience this error with the definition of certain exceptions that use std::exception as a base class.
I will raise a separate question for that because I expect it relates to "add_exception".
Gustavo, Thank you very much for your help.