oprypin / crsfml

Crystal bindings to SFML multimedia/game library

Home Page:https://oprypin.github.io/crsfml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't generate on OS X

alanwillms opened this issue · comments

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

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)

9b7534d

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

@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.