On Wed, 16 Apr 2003 00:34:33 +0900, ts wrote:

>>>>>> "S" == Simon Strandgaard <0bz63fz3m1qt3001 / sneakemail.com> writes:
> 
> S> http://metaeditor.sourceforge.net/embed/rubyembed-0.1.tar.gz
> 

I have just installed the newest SWIG version 1.3.19 and generated a new
wrapper. But it still FAILs!!

> ./testswig
main: enter
test.rb: enter
test.rb: leave
aeditorlib: started (with-swig)
-- Test1 simple ----------------------
view.ctor: enter
rubyview.initialize: overloaded
redirect.ctor: hello
objects += 8108cf0
view.ctor: leave
view.insert: enter
rubyview.insert: enter
view.dtor: enter
objects -= 8108cf0
view.dtor: leave
EXCEPTION (RUBY):
name=cannot invoke ruby-function
where=./test.rb:17
class=TypeError
message=wrong argument type RubyView (expected Data)
backtrace=      from ./test.rb:17:in `repaint'
        from ./test.rb:17:in `insert'

main: leave (1)
> tail -18 rubycpp.cpp
        VALUE self = rb_class_new_instance(a.n, a.argv, klass);
        //VALUE self = rb_funcall2(klass, rb_intern("new"), a.n, a.argv);
        return self;
}

VALUE New(string klass) {
        NewArguments arg(klass.c_str(), 0, 0);
        int error = 0;
        VALUE self = rb_protect(NewWrap, reinterpret_cast<VALUE>(&arg), &error);
        if(error) {
                std::ostringstream o;
                o << "error creating " << klass;
                throw RUBY_CPP::RubyError::Create(o.str());
        }
        return self;
}

} // end of namespace RUBY_CPP
> swig -version

SWIG Version 1.3.19
Copyright (c) 1995-1998
University of Utah and the Regents of the University of California
Copyright (c) 1998-2002
University of Chicago
Compiled with g++

Please see http://www.swig.org for reporting bugs and further information
> ruby -v
ruby 1.8.0 (2003-03-03) [i386-freebsd5.0]
>


 
>  and I've no problems

There is 2 binaries, I think you executed the wrong one.
> 
> pigeon% ./testswig
> main: enter
> test.rb: enter
> test.rb: leave
> aeditorlib: started (no-swig)
                       ^^^^^^^
                       ^^^^^^^
If you ran the "testswig" program, it should say "with-swig"...
I think you ran the "test" program :-)

Try again :-)


--
Simon Strandgaard