[sword-devel] Python binding issue: non-default constructor in class without a constructor

Ben Morgan benpmorgan at gmail.com
Tue Jun 17 16:49:30 MST 2008

The problem occurs because SWIG cannot handle nested classes properly, so I
have to have an outer class to do it. This means that swig needs to see one
version so it will generate the correct bindings, and the c++ compiler needs
to see what really is happening.

The setup.py script currently defines the SWIG macro, meaning that the c++
compiler is looking at the version that swig looks at. This shouldn't be

These two solutions should work:
1. Remove this line in setup.py (Note: I haven't tried this...)


2. Or even better, build it with configure (from the package directory)
make pythonswig
make python_make
cd python
python setup.py install

Hope this helps.

God Bless,
The Lord is not slow to fulfill his promise as some count slowness,
but is patient toward you, not wishing that any should perish,
but that all should reach repentance.
2 Peter 3:9 (ESV)

On Wed, Jun 18, 2008 at 3:00 AM, Pierre Amadio <pierre.amadio at laposte.net>

> Hi there.
> I'm trying to compile sword 1.5.11 as well as the python binding for the
> maemo platform. Things were working smoothly with 1.5.10, but i run into
> troubles when trying to compile this with the sword 1.5.11.
> Somes details about what happened are available here:
> http://lists.maemo.org/pipermail//maemo-developers/2008-June/033857.html
> Most of the problem i encouter seems to be due to the fact that en
> environment i have to use already comes with it s own swig version and i
> have trouble overriding this version.
> But, even when i (think i) succeed in doing so, i meet another problem:
> rendercallback.h:189: error: base `sword::BasicFilterUserData' with only
> non-default constructor in class without a constructor
> rendercallback.h:212: error: base `sword::BasicFilterUserData' with only
> non-default constructor in class without a constructor
> I also had the same error when i get rid of the swig version available
> in scracthbox the easy way (renaming executable and directory) so i was
> sure it will not be taken in account.
> Now, at both those lines in rendercallback.h, a comment states
> // trick SWIG into thinking this is not inherited from an inner class...
> I do not know why i can hit this problem only in scratchox and not on a
> vanilla debian (where compilations works without those error message).
> Could it be the "trick" is not working as expected ?
> I know nearly nothing about c++, so i m only guessing, but would adding
> a constructor in BasicFilterUserData class be an option ?
> There does not seem to be one in swbasicfilter.h
> Any feedback would be appreciated.
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20080618/2825c967/attachment.html 

More information about the sword-devel mailing list