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

'Cannot alias an expression 0' error

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



Joined: 01 Jun 2008
Posts: 1

PostPosted: Sun Jun 01, 2008 4:41 pm    Post subject: 'Cannot alias an expression 0' error Reply with quote

Hello D community,

I come from a Python background, and know my way around C and Java, and just found D today and that I'd take a look at it. Than, I found PyD, and thought now I really have to look at this. So I just copy and pasted the examples of of a PyD module and CeleriD setup.py script, and the error I get when I run it.

PyD module (saved as 'testing_pyd.d'):
Code:

import pyd.pyd;
import std.stdio;

void hello_func()
{
    writefln("Hello, world!");
}

extern (C) void PydMain()
{
    def!(hello_func);
    module_init();
}


Setup script (saved as 'setup.py'):
Code:

from celerid.support import setup , Extension

project = 'testing_pyd'

setup(
   name = project,
   ext_modules=[
      Extension(project , [project + '.d'])
   ],
)


And the error
Code:

jason@jason-ubuntu:~$ cd Desktop/pyd_tests
jason@jason-ubuntu:~/Desktop/pyd_tests$ ls
setup.py  testing_pyd.d
jason@jason-ubuntu:~/Desktop/pyd_tests$ python setup.py build
running build
running build_ext
building 'testing_pyd' extension
sources:  ['testing_pyd.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', 'op_wrap.d', 'pyd.d', 'pydobject.d', 'struct_wrap.d', 'pydmain.d', 'Default.d', 'Demangle.d', 'Nameof.d', 'Util.d', 'python_so_linux_boilerplate.d']
gdc -fPIC -c -fversion=Python_2_5_Or_Later -fversion=Python_Unicode_UCS4 -fdebug -I /usr/local/lib/python2.5/site-packages/celerid/infrastructure/python/2.5 -I /usr/local/lib/python2.5/site-packages/celerid/infrastructure -o build/temp.linux-i686-2.5/project/testing_pyd.o testing_pyd.d
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../include/d/4.2.3/std/bind.d:317: alias std.bind.minNumArgs_impl!(hello_func,void(*)()).res cannot alias an expression 0
error: command 'gdc' failed with exit status 1
jason@jason-ubuntu:~/Desktop/pyd_tests$
Back to top
View user's profile Send private message
eko



Joined: 10 Jun 2008
Posts: 2

PostPosted: Tue Jun 10, 2008 5:23 am    Post subject: Similar Error Reply with quote

I also have similar error, but this time its DMD for windows. I tried to compile hello.d on examples.But following error occur.All celerid installation seem work properly.

DMD ver 2.014
Python ver 2.5.2
Celerid ver RC1

DMD compiler is on D:\DMD
Python is on D:\Python 2.5

(click to enlarge)



Does anyone know how to solve this problem.I really appreciate it.Thank You.
Back to top
View user's profile Send private message
eko



Joined: 10 Jun 2008
Posts: 2

PostPosted: Tue Jun 10, 2008 5:29 am    Post subject: python.d Error Reply with quote

I also have similar error, its like "python.d" don't work. I tried to compile hello.d on examples.But following error occur.All celerid installation seem work properly.

DMD ver 2.014
Python ver 2.5.2
Celerid ver RC1

DMD compiler is on D:\DMD
Python is on D:\Python 2.5

(click to enlarge)



Does anyone know how to solve this problem.I really appreciate it.Thank You.
Back to top
View user's profile Send private message
merc



Joined: 28 Apr 2010
Posts: 3

PostPosted: Wed Apr 28, 2010 3:46 pm    Post subject: It dosn't work!!!!! Reply with quote

Pyd does not seem to be supported due to the lack of responses to your post. I have the same issue after fixing other things like the following:

/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:1876: found 'ref' when expecting ')'
/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:1876: semicolon expected following function declaration
/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:1876: Declaration expected, not ')'
/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:1881: found 'ref' when expecting ')'
/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:1881: semicolon expected following function declaration
/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:1881: Declaration expected, not ')'
/usr/lib/python2.4/site-packages/celerid/infrastructure/python/2.4/python.d:3208: unrecognized declaration

All this pretty much means that he used a defined keyword "ref" as a pointer name. I changed these and low and behold I get the same "alias to 0" error you speak of. I decided to can it since it would take too much work to try and figure out what is causing this. But my main conclusion is that the newer gdc / dmd 1.x compilers are not supported for this project. This would really be a neat project if someone would take it over but as it currently stands it dosn't work.

By the way, I tried Python versions 2.4,2.5, and 2.6, all with the same problem and leads me to believe its a coding issue with Pyd not being compatible with the newer compilers.
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