Hi Michael,
Unfortunately, the problem is not always reproducible with a simple
“cmake …/ && make clean && make”, I have to remove the build
directory completely. I have tried all combinations, and now I seem to
have something that seem to work. The problem is that I need a
rational_sync_block(void) {} // allows pure virtual interface
sub-classes
constructor in order to declare interface classes in my include
directory. These interface classes are inheriting from
rational_sync_block with virtual inheritance. So when SWIG is scanning
the header files, then it decides that it is going to create a wrapper
around the empty constructor (and I do not know why it does this). But
you cannot instantiate this interface class, you have to use make
which will create the proper implementation. Anyhow, the solution was
to conditionally create a different class definition for swig like
below. If I do not do this special case, then the error is there.
Also, it is not clear what and how to set up my swig .i file, but some
combination seems to work now.
#ifdef SWIG_VERSION
class rational_sync_block : public gr::sync_block
{
protected:
rational_sync_block(const std::string &name,
gr::io_signature::sptr input_signature, gr::io_signature::sptr
output_signature,
unsigned int interpolation, unsigned int decimation);
};
#else
class rational_sync_block: public gr::sync_block
{
private:
unsigned int d_interpolation;
unsigned int d_decimation;
protected:
rational_sync_block(void) {} // allows pure virtual interface
sub-classes
rational_sync_block(const std::string &name,
gr::io_signature::sptr input_signature, gr::io_signature::sptr
output_signature,
unsigned int interpolation, unsigned int decimation);
public:
unsigned int interpolation() const { return d_interpolation; }
unsigned int decimation() const { return d_interpolation; }
void set_interpolation(unsigned int interpolation, unsigned int
decimation);
int fixed_rate_ninput_to_noutput(int ninput);
int fixed_rate_noutput_to_ninput(int noutput);
void forecast(int noutput_items, gr_vector_int
&ninput_items_required);
// derived classes should override work
int general_work(int noutput_items, gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items, gr_vector_void_star
&output_items);
};
#endif
Miklos