Pyd: Wrapping too many functions in a class gives a compiler error

Simen Haugen simen at norstat.no
Fri Jul 13 01:25:33 PDT 2007


I'm now trying rev 118 and dmd 1.018.

If I use the ordinary wrap_class I get the "identifier too long" error.

If I use mixin _wrap_class!(...) outside of PydMain, I get an error when 
wrapping the first class.
The error is different based on what class I try to wrap first. With this 
class:
class NSDError : Error {
    this() {
        super("UNKNOWN");
    }

    this(char[] msg) {
        super(msg);
    }
}

I get:
pynsd.d(40): Error: wrap_class!(NSDError,Init!(void(*)(char[] filename)) ) 
has no effect

Notice that it has char[] filename here, but char[] msg in the class


"Kirk McDonald" <kirklin.mcdonald at gmail.com> wrote in message 
news:f75i9t$jt3$1 at digitalmars.com...
> Simen Haugen wrote:
>> To use it, you create a mixin of _wrap_class outside of the main 
>> function, and initialize it after module_init() as before?
>> Thats what I tried, but then I get a message about "identifier PyObject 
>> not defined" in make_wrapper.d line 91.
>>
>> I only tried this on my large class, the other are still using 
>> wrap_class!(...)
>>
>
> Bah, the devil is in the details... For now, add
>     import python;
> to the top of your module. That should fix it for now.
>
> -- 
> Kirk McDonald
> http://kirkmcdonald.blogspot.com
> Pyd: Connecting D and Python
> http://pyd.dsource.org 





More information about the Digitalmars-d mailing list