killy-kun
3/20/2006 9:28:00 PM
> I'm not sure what else to suggest. If you'd like, tar up your code and
> your build script, email it to me, and I'll try to get it to run.
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
>
Thank you very much for your proposition.
For the moment, the only thing I trying to make work is the str.i, where
all the code is included, and that is displayed below.
Here is what I tried :
#------------------------------#
[gnargeot@dptinfo ex3]$ cat str.i
%module str
%inline %{
#include <string>
using namespace std;
string fctBidon (const string& s)
{
string res;
res = s + " salt bidon";
return res;
}
string bidon()
{
string res = "bouh";
return res;
}
%}
%include "std_string.i"
[gnargeot@dptinfo ex3]$ swig -c++ -ruby *.i
[gnargeot@dptinfo ex3]$ set RBDIR = /usr/lib/ruby/1.8/i386-linux/
[gnargeot@dptinfo ex3]$ gcc -c -fpic *_wrap.cxx -I. -I$RBDIR
[gnargeot@dptinfo ex3]$ gcc -shared -fpic *_wrap.o -lstdc++ -o Str.so
[gnargeot@dptinfo ex3]$ irb --simple-prompt
>> require './Str.so'
LoadError: ./Str.so: undefined symbol: Init_Str - ./Str.so
from ./Str.so
from (irb):1
>> require './Str.so'
=> false
#------------------------------#
Hope I will manage to make this work :/
For the moment, it doesn't work at all, compared to my previous building
method, that used the Makefile provided in the examples directories of
the swig pack. But when building with these makefiles, I still had c++
strings recognized as "TYPE_p_string" ...