oprypin / crsfml

Crystal bindings to SFML multimedia/game library
https://oprypin.github.io/crsfml
zlib License
350 stars 14 forks source link

Can't generate on OS X #3

Closed alanwillms closed 9 years ago

alanwillms commented 9 years ago

When I run ./generate/generate.sh or ./generate.sh I get the following errors:

Traceback (most recent call last):
  File "generate.py", line 605, in <module>
    Visitor().visit(ast)
  File "/usr/local/lib/python3.4/site-packages/pycparser/c_ast.py", line 120, in visit
    return visitor(node)
  File "/usr/local/lib/python3.4/site-packages/pycparser/c_ast.py", line 127, in generic_visit
    self.visit(c)
  File "/usr/local/lib/python3.4/site-packages/pycparser/c_ast.py", line 120, in visit
    return visitor(node)
  File "generate.py", line 518, in visit_Typedef
    node.type.type.my_name = node.type.declname
AttributeError: 'Struct' object has no attribute 'my_name'
cp: generate/*.cr: No such file or directory
rm: generate/*.cr: No such file or directory

This is my environment:

Crystal 0.7.4
Python 3.4.3
CSFML 2.3
pycparser 2.14
oprypin commented 9 years ago

As I recently found out, some release of pycparser made it so I can't write my custom data to its objects. This means that (at least for now) version 2.10 is the last version that works.

pip3 install --user 'pycparser==2.10'

(--user is optional, I just like it)

oprypin commented 9 years ago

https://github.com/BlaXpirit/crsfml/commit/9b7534de0af941b73da06f65a3a57c1afe65c4be

Let me know if this helps, and I'm also curious about why you need to generate.

alanwillms commented 9 years ago

@BlaXpirit I got it wrong. I should just require the .cr files, but I thought I had to compile them before using. Thank you anyway, your comment made me understand.