FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Class Wrap Build Problems

 
Post new topic   Reply to topic     Forum Index -> PyD
View previous topic :: View next topic  
Author Message
angelblaze



Joined: 26 Nov 2007
Posts: 5
Location: South Africa

PostPosted: Sun Dec 02, 2007 5:39 am    Post subject: Class Wrap Build Problems Reply with quote

I am having problem with wrapping classes, even the arraytest example does not work, so probably a problem with my D version. What is the version that are known to work?

---------------------------------

C:\d\uxAccel\pyd\examples\arraytest>setup.py build
running build
running build_ext
building 'arraytest' extension
sources: ['arraytest.d', 'python.d', 'class_wrap.d', 'ctor_wrap.d', 'def.d', 'd
g_convert.d', 'exception.d', 'func_wrap.d', 'lib_abstract.d', 'make_object.d', '
make_wrapper.d', 'op_wrap.d', 'pyd.d', 'pydobject.d', 'struct_wrap.d', 'pydmain.
d', 'Default.d', 'Demangle.d', 'Nameof.d', 'Util.d', 'python_dll_windows_boilerp
late.d']
c:\d\dmd\bin\dmd.exe -c -version=Python_2_5_Or_Later -version=Python_Unicode_UCS
2 -debug -IC:\Python25\lib\site-packages\celerid\infrastructure\python -IC:\Pyth
on25\lib\site-packages\celerid\infrastructure -ofbuild\temp.win32-2.5\Release\pr
oject\arraytest.obj arraytest.d
def: get
def: set
def: test
wrap_class: Foo
class wrapper : T {
mixin OverloadShim;
alias Params[0] __pyd_p0;
alias __pyd_p0.ctors __pyd_c0;
this(ParameterTypeTuple!(__pyd_c0[0]) t) {
super(t);
}
static if (is(typeof(new T))) {
this() { super(); }
}
alias Params[2] __pyd_p2;
ReturnType!(__pyd_p2.func_t) bar(ParameterTypeTuple!(__pyd_p2.func_t) t) {
return __pyd_get_overload!("bar", __pyd_p2.func_t).func("bar", t);
}

}

shim.mangleof: C3pyd12make_wrapper200__T12make_wrapperTC9arraytest3FooTS3pyd10cl
ass_wrap15__T4InitTPFiZvZ4InitTS3pyd10class_wrap42__T4ReprS30_D9arraytest3Foo8to
StringMFZAaZ4ReprTS3pyd10class_wrap35__T3DefS24_D9arraytest3Foo3barMFZvZ3DefZ7wr
apper
class.def: bar
(12): template pyd.make_wrapper.make_wrapper!(Foo,Init!(void(*)(int)) ,Repr!(toS
tring) ,Def!(bar) ).wrapper.OverloadShim!().__pyd_get_overload!("bar",void(*)())
.func(T...) does not match any template declaration
(12): template pyd.make_wrapper.make_wrapper!(Foo,Init!(void(*)(int)) ,Repr!(toS
tring) ,Def!(bar) ).wrapper.OverloadShim!().__pyd_get_overload!("bar",void(*)())
.func(T...) cannot deduce template function from argument types (char[3])
C:\Python25\lib\site-packages\celerid\infrastructure\pyd\class_wrap.d(571): temp
late instance pyd.class_wrap._wrap_class!(Foo,"Foo",Init!(void(*)(int)) ,Repr!(t
oString) ,Def!(bar) ) error instantiating
error: command 'c:\d\dmd\bin\dmd.exe' failed with exit status 1
Back to top
View user's profile Send private message
KirkMcDonald



Joined: 22 Jun 2006
Posts: 23

PostPosted: Thu Dec 06, 2007 6:33 pm    Post subject: Re: Class Wrap Build Problems Reply with quote

angelblaze wrote:
I am having problem with wrapping classes, even the arraytest example does not work, so probably a problem with my D version. What is the version that are known to work?


I admit that I have been lax in keeping Pyd up to date with the latest DMD versions. :-) The last versions I've actually tested it with are 1.020 and 2.003. Give me a little more time and I will figure out when Pyd broke and what broke it.
Back to top
View user's profile Send private message
christof



Joined: 09 Jan 2008
Posts: 7
Location: Hamburg/ Germany

PostPosted: Wed Jan 09, 2008 5:18 am    Post subject: Class Wrap Build Problems Reply with quote

I get the same error message with dmd version 1.015.

I would really like to get pyd to work. It looks very promising for me.

-- Christof
Back to top
View user's profile Send private message
angelblaze



Joined: 26 Nov 2007
Posts: 5
Location: South Africa

PostPosted: Wed Jan 09, 2008 6:31 am    Post subject: Reply with quote

I am using DMD version 1.017 and it works for me. Should have updated the topic since I started it.

Do you have MinGW installed? It caused some problems for me, eg. not detecting dmd compiler etc.
Back to top
View user's profile Send private message
christof



Joined: 09 Jan 2008
Posts: 7
Location: Hamburg/ Germany

PostPosted: Wed Jan 09, 2008 6:58 am    Post subject: Class Wrap Build Problems Reply with quote

Thanks for the reply. Where can I get DMD version 1.017 ?

On http://www.digitalmars.com/d/dcompiler.html I can only find 1.015 and 2.007. What about 2.007?

I have mingw installed, but I do not think this is the problem. Dmd.exe is called as it should. Below is the result when I try to compile the array example.

-- Christof


Code:
$ python  setup.py  build
running build
running build_ext
building 'arraytest' extension
sources:  ['arraytest.d', 'python.d', 'class_wrap.d', 'ctor_wrap.d', 'def.d', 'dg_convert.d', 'exception.d', 'func_wrap.d', 'lib_abstract.d', 'make_object.d', 'make_wrapper.d', 'op_wrap.d', 'pyd.d', 'pydobject.d', 'struct_wrap.d', 'pydmain.d', 'Default.d', 'Demangle.d', 'Nameof.d', 'Util.d', 'python_dll_windows_boilerplate.d']
c:\D\dmd\bin\dmd.exe -c -version=Python_2_5_Or_Later -version=Python_Unicode_UCS2 -debug -Ic:\python25\lib\site-packages\celerid\infrastructure\python -Ic:\python25\lib\site-packages\celerid\infrastructure -ofbuild\temp.win32-2.5\Release\project\arraytest.obj arraytest.d
def: get
def: set
def: test
wrap_class: Foo
class wrapper : T {
    mixin OverloadShim;
    alias Params[0] __pyd_p0;
    alias __pyd_p0.ctors __pyd_c0;
    this(ParameterTypeTuple!(__pyd_c0[0]) t) {
        super(t);
    }
    static if (is(typeof(new T))) {
        this() { super(); }
    }
    alias Params[2] __pyd_p2;
    ReturnType!(__pyd_p2.func_t) bar(ParameterTypeTuple!(__pyd_p2.func_t) t) {
        return __pyd_get_overload!("bar", __pyd_p2.func_t).func("bar", t);
    }

}

shim.mangleof: C3pyd12make_wrapper200__T12make_wrapperTC9arraytest3FooTS3pyd10class_wrap15__T4InitTPFiZvZ4InitTS3pyd10class_wrap42__T4ReprS30_D9arraytest3Foo8toStringMFZAaZ4ReprTS3pyd10class_wrap35__T3DefS24_D9arraytest3Foo3barMFZvZ3DefZ7wrapper
class.def: bar
(12): template pyd.make_wrapper.make_wrapper!(Foo,Init!(void(*)(int)) ,Repr!(toString) ,Def!(bar) ).wrapper.OverloadShim!().__pyd_get_overload!("bar",void(*)()).func(T...) does not match any template declaration
(12): template pyd.make_wrapper.make_wrapper!(Foo,Init!(void(*)(int)) ,Repr!(toString) ,Def!(bar) ).wrapper.OverloadShim!().__pyd_get_overload!("bar",void(*)()).func(T...) cannot deduce template function from argument types (char[3])
c:\python25\lib\site-packages\celerid\infrastructure\pyd\class_wrap.d(571): template instance pyd.class_wrap._wrap_class!(Foo,"Foo",Init!(void(*)(int)) ,Repr!(toString) ,Def!(bar) ) error instantiating
error: command 'c:\D\dmd\bin\dmd.exe' failed with exit status 1
Back to top
View user's profile Send private message
angelblaze



Joined: 26 Nov 2007
Posts: 5
Location: South Africa

PostPosted: Wed Jan 09, 2008 7:42 am    Post subject: Reply with quote

from
http://www.digitalmars.com/d/1.0/changelog.html#new1_017

2.007 didn't work for me.


~Gerdus van Zyl
Back to top
View user's profile Send private message
christof



Joined: 09 Jan 2008
Posts: 7
Location: Hamburg/ Germany

PostPosted: Wed Jan 09, 2008 7:55 am    Post subject: Reply with quote

The array demo works.

Very nice! Thanks!

-- Christof
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> PyD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group