I seem to have gotten a bit further by mimic the early ZeroMQ perl module tsee made.
This is my class xsp now: https://github.com/PerlGameDev/Box2D-perl/blob/master/xsp/b2Vec2.xsp But now I am running into: cc -I/home/kthakore/.perl5/perls/perl-5.12.2/lib/5.12.2/x86_64-linux-thread-multi/CORE -DXS_VERSION="0.01" -DVERSION="0.01" -fPIC -xc++ -Isrc -Ibuildtmp -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o buildtmp/Box2D.o buildtmp/Box2D.c buildtmp/Box2D.c:97: error: expected class-name before ‘extern’ error building buildtmp/Box2D.o from 'buildtmp/Box2D.c' at /home/kthakore/.perl5/perls/perl-5.12.2/lib/5.12.2/ExtUtils/CBuilder/Base.pm line 112. Regards, Kartik Thakore On Tue, 2011-04-26 at 11:02 -0400, Kartik Thakore wrote: > Hi, > > I am trying to bind Box2D to Perl using XSpp. This is my code so far: > https://github.com/PerlGameDev/Box2D-perl > > I am using Module::Build::WithXSpp and ExtUtils::XSpp. The first thing I > need to bind are a bunch of C++ style structs (not pure C struct). > > http://paste.scsys.co.uk/99657 > > It has operator overloads and so on. > > The ExtUtils::XSpp is not clear on how I should handle this. I tried > doing > > https://github.com/PerlGameDev/Box2D-perl/blob/master/xsp/Box2D.xsp > > but when I compile and run I get: > > > Building Box2D > Generating main XS file... > Error: line 7 (Current token type: 'OPCURLY') (Current value: '{') Buffer: " > " > Expecting: ('OPPAR') > Error reading from pipe > '/home/kthakore/.perl5/perls/perl-5.12.2/bin/perl5.12.2 -MExtUtils::XSpp::Cmd > -e xspp -- > /home/kthakore/Documents/Development/Box2D-perl/Box2D/xsp/Box2D.xsp': in > main.xs, line 22 > > > Any help will be appreciated. > > Regards, -- Kartik Thakore <thakore.kar...@gmail.com>