Swig and the STL

I am having troubles with swig’s conversion of STL to ruby. Mainly ruby
sees the STL containers as being empty. Is this a know issue with swig?
I am running swig version 1.3.16, and ruby 1.8.0. Does anyone know of a
place that I can check known issues with swig and ruby?

···


Michael
GnuPG Fingerprint: 4C56 7C23 8BD9 8B39 C4D4 B8F3 42FB 3634 31B5 E963

I would ask this question on the SWIG mailing list. There is some
discussion about making the list a pseudo-members-only list so it’d be best
to join before posting to it (not sure exactly how far these policies have
gone yet).

Regardless, if you’ll be using SWIG/Ruby it’d be beneficial to discuss
things there.

Personally I’m using ruby 1.7.3 and SWIG 1.3.17 with the STL without
problem–but I’ve been doing custom typemaps instead of using the default
ones (which didn’t exist when I started), so that data point may not be of
that much use to you.

···

On Jun 29, Michael Brailsford wrote:

I am having troubles with swig’s conversion of STL to ruby. Mainly ruby
sees the STL containers as being empty. Is this a know issue with swig?
I am running swig version 1.3.16, and ruby 1.8.0. Does anyone know of a
place that I can check known issues with swig and ruby?


Michael
GnuPG Fingerprint: 4C56 7C23 8BD9 8B39 C4D4 B8F3 42FB 3634 31B5 E963

I am having troubles with swig’s conversion of STL to ruby. Mainly ruby
sees the STL containers as being empty. Is this a know issue with swig?
I am running swig version 1.3.16, and ruby 1.8.0. Does anyone know of a
place that I can check known issues with swig and ruby?

Just to update. I am using swig 1.3.16, and the behavior I have noticed
is that whenever I call a .each on any vector that has been wrapped by
swig, ruby segfaults.

I would ask this question on the SWIG mailing list. There is some
discussion about making the list a pseudo-members-only list so it’d be best
to join before posting to it (not sure exactly how far these policies have
gone yet).

Regardless, if you’ll be using SWIG/Ruby it’d be beneficial to discuss
things there.

I will take that advice.

Personally I’m using ruby 1.7.3 and SWIG 1.3.17 with the STL without
problem–but I’ve been doing custom typemaps instead of using the default
ones (which didn’t exist when I started), so that data point may not be of
that much use to you.

I am using ruby 1.8, and swig 1.3.16. If you don’t mind could you tell
the main things to consider when writing a custom typemap for an stl
conatiner? I have pretty much resigned myself to writing my own
typemap, and pointers from someone that has done it for std::vector
would be appreciated.

···


Michael
GnuPG Fingerprint: 4C56 7C23 8BD9 8B39 C4D4 B8F3 42FB 3634 31B5 E963

I am having troubles with swig’s conversion of STL to ruby.
Mainly ruby sees the STL containers as being empty. Is this
a know issue with swig?
I am running swig version 1.3.16, and ruby 1.8.0. Does anyone
know of a place that I can check known issues with swig and ruby?

Just to update. I am using swig 1.3.16, and the behavior I have noticed
is that whenever I call a .each on any vector that has been wrapped by
swig, ruby segfaults.

Michael,
I suppose I’m the guilty party—I wrote the std::vector
typemaps included with SWIG. They work for me, namely, I’m not able
to reproduce the .each segfault you describe with the latest version.
It would be of great help if you could put together a self-contained
example showing the problem and send it to me (private e-mail is fine.)

I am using ruby 1.8, and swig 1.3.16.

Hmm, I’m using 1.6.8 and 1.3.19, respectively. I might try 1.8 if your
example works on 1.6.8, though.

Later,
Luigi

···

On Tue, 01 Jul 2003 17:48:51 +0900, Michael Brailsford wrote: