From: Randy Barlow <randy@el...> - 2010-02-17 17:38:52
Hello! I am new to swig. I apologize if this question has been pondered
on here before. I was unable to determine how to search the list
archives before asking this question...
I've got a pretty simple C++ method that has a signature like this:
double method(const char *input_text, int *output_1, int *output_2);
So I made a swig interface file with this:
double method(const char * INPUT, int *OUTPUT, int *OUTPUT);
There are a couple of strange things. The most strange to me is that it
sort of works on 32 bit Linux (Ubuntu Karmic) but not the same distro 64
bit version. The failure is a segmentation fault, which is very
difficult to debug.
However, on the 32 bit side of things, both of the OUTPUT ints always
end up being 0. I have a C++ client that can call this method and get
the expected (non zero) output.
Anybody seen such problems before, particularly the 32/64 bit difference?
I am using Python 2.6 and swig 1.3.36 (both the versions that ship with
Thanks, and apologies again if this has been discussed before. I'd
appreciate a link to that discussion!
From: Randy Barlow <randy@el...> - 2010-02-17 19:37:34
Randy Barlow wrote:
> Anybody seen such problems before, particularly the 32/64 bit difference?
I've solved my problem sort of. I still cannot explain why it's
different between 32 and 64 bit, but what made it work was to use the
array_class and pointer_class macros. It took me a while of reading all
over the docs to find and try this, but I've been able to achieve what I
needed to achieve. Sorry for the noise!