weird SWIG syntax error with "inline" keyword (was: Re: Python bindings)

Christian Stimming stimming at tuhh.de
Mon Jul 7 17:26:48 EDT 2008


Am Montag, 7. Juli 2008 22:36 schrieb Mark Jenkins:
> Rolf wrote:
> >> How can I enable this code?  I think it used to live in
> >> src/optional/python-bindings, but I can't find it there.
>
> Right path, but not available in GnuCash proper for the reasons Derek
> mentions. (see details earlier in thread)
>
> For now, you can get a patch from last month at
> http://savannah.nongnu.org/projects/python-gnucash
>
> configure with --enable-python-bindings

By the way, one very weird error that I get with SWIG-1.3.31 and your 
python/swig bindings is this:

$ make -C src/optional/python-bindings
swig -python -Wall -Werror \
        -I../../../../src -I../../../../src/engine \
                -I../../../../src/business/business-core \
                -I../../../lib/libqof/qof -I../../../../lib/libqof/qof -o 
gnucash_core.c ../../../../src/optional/python-bindings/gnucash_core.i
../../../../lib/libqof/qof/gnc-numeric.h:243: Error: Syntax error in input(1).
make: *** [gnucash_core.c] Fehler 1

Turns out swig doesn't like the "inline" keyword at all of the places in the 
<gnc-numeric.h> header. If I add the option

  -Dinline=

to the swig call (i.e. defining inline as an empty macro), swig runs without 
error and the build continues just fine.

No idea whether this is specific to this swig version or what. I just thought 
I'd better send this to the mailing list before I wonder again about this for 
a long time.

Christian


More information about the gnucash-devel mailing list