in reply to interface perl to C++ code with SWIG, re: void pointers?

After my initial gaff, I'll have another crack at providing something that might be marginally useful - and I second stevieb's request for more info.
Inline::CPP and (Inline::C) seem to be quite happy to directly access the library's version() function: Here's the Inline::CPP demo:
################ package FOO; use strict; use warnings; use Inline CPP => Config => BUILD_NOISY => 1, ; use Inline CPP => <<'EOC'; int version(void * p) { return 42; } EOC my $sv = 'whatever'; my $obj = bless \$sv, 'FOO'; print $obj->version(); ################
That works just fine and outputs '42'.
Of course, it's a little bit different in your case because version() is in a separate library, so your script would be something like:
################ package FOO; use strict; use warnings; use Inline CPP => Config => INC => '/path/to/include', LIBS => '-L/path/to/library -lmy_lib', BUILD_NOISY => 1, ; use Inline CPP => <<'EOC'; #include <my_lib.h> int wrap_version(SV * p) { return version(p); } EOC my $sv = 'whatever'; my $obj = bless \$sv, 'FOO'; print $obj->wrap_version(); ################
or, if you want to call the sub from perl as "version":
################ package FOO; use strict; use warnings; use Inline CPP => Config => PREFIX => 'wrap_', INC => '/path/to/include', LIBS => '-L/path/to/library -lmy_lib', BUILD_NOISY => 1, ; use Inline CPP => <<'EOC'; #include <my_lib.h> int wrap_version(SV * p) { return version(p); } EOC my $sv = 'whatever'; my $obj = bless \$sv, 'FOO'; print $obj->version(); ################
I think SWIG should be capable of providing the same result.

Cheers,
Rob