Swig and the STL

M

Michael Brailsford

--pvezYHf7grwyp3Bc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--pvezYHf7grwyp3Bc
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+/fWpQvs2NDG16WMRAhEmAJ9qQLDrl3V1Uyq9dlIA0CXtKZ4cIACgvF9h
vDje27uXw/SxU5HY1F4lpeo=
=kTER
-----END PGP SIGNATURE-----

--pvezYHf7grwyp3Bc--
 
B

Brett H. Williams

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?

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.
 
M

Michael Brailsford

--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--Dxnq1zWXvFF0Q93v
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/AUrvQvs2NDG16WMRAhZUAKDxI+sEhLjgIq4HjYZ3cmreVMDubwCeKqVr
zue5Sg2lTnj6mTcpHzmYmp0=
=AVGy
-----END PGP SIGNATURE-----

--Dxnq1zWXvFF0Q93v--
 
L

Luigi Ballabio

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top