Perl bindings for libchamplain



Hi,

I'm trying to write the Perl bindings for libchamplain
(http://blog.pierlux.com/projects/libchamplain/en/) and I'm struggling
with a simple enum. The C library defines the enum "ChamplainViewMode"
which I have added to my map file. I'm able to generate the XS code
and to compile the module to a .so but when I try to load the Perl
module in a sample file I get:

perl: symbol lookup error:
blib/arch/auto/Clutter/Ex/Champlain/Champlain.so: undefined symbol:
SvChamplainViewMode

It seems that the macro SvChamplainViewMode got left in the C code and
the compiler assumed it to be a C function. If I run a grep I can see
that the macro SvChamplainViewMode exists:

grep -R SvChamplainViewMode .
./xs/ChamplainView.c:   ChamplainViewMode       mode = SvChamplainViewMode (ST(1));
./blib/arch/Clutter/Ex/Champlain/Install/champlain-autogen.h:# define
SvChamplainViewMode(sv) ((ChamplainViewMode)gperl_convert_enum
(CHAMPLAIN_TYPE_VIEW_MODE, sv))
./build/champlain-autogen.h:# define
SvChamplainViewMode(sv) ((ChamplainViewMode)gperl_convert_enum
(CHAMPLAIN_TYPE_VIEW_MODE, sv))

As a temporary hack I've replaced the enum by an int and I got a
little bit further, at least I can test the bindings.

The code is not available publicly in a repository as I haven't
committed my self to a final name for the module (I might rename it to
Gtk2::Champlain since libchamplain and libchamplain-gtk have been
merged). I have attached the first sketch of the bindings to the mail.

All suggestions for the package are welcome.

-- 
Emmanuel Rodriguez

Attachment: Clutter-Ex-Champlain.tar.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]