crystal-lang / crystal_lib

Automatic binding generator for native libraries in Crystal
138 stars 30 forks source link

Running the example crashes #36

Closed bararchy closed 7 years ago

bararchy commented 7 years ago
/usr/include/time.h:37:11: fatal error: 'stddef.h' file not found
Don't know how to convert struct __fsid_t (119) (Exception)
mverzilli commented 7 years ago

What example?

bararchy commented 7 years ago

@mverzilli This happens with all of them, same issue, same error.

Using Arch Linux and Crystal HEAD

It even seems now that after pulling HEAD again I see a different error:

src/main.cr -- examples/libc.cr
Error in src/main.cr:6: instantiating 'Crystal::ASTNode+#transform(CrystalLib::LibTransformer)'

transformed = node.transform visitor
                   ^~~~~~~~~

in /usr/lib/crystal/compiler/crystal/syntax/transformer.cr:7: instantiating 'CrystalLib::LibTransformer#transform(Crystal::ASTNode+)'

      node = transformer.transform self
                         ^~~~~~~~~

in src/crystal_lib/lib_transformer.cr:18: instantiating 'CrystalLib::Parser:Class#parse(String, Array(String))'

    nodes = CrystalLib::Parser.parse(headers, flags)
                               ^~~~~

in src/crystal_lib/parser.cr:6: instantiating 'CrystalLib::Parser#parse()'

    parser.parse
           ^~~~~

in src/crystal_lib/parser.cr:23: instantiating 'visit(Clang::Cursor)'

      node = visit(cursor)
             ^~~~~

in src/crystal_lib/parser.cr:38: instantiating 'visit_var_declaration(Clang::Cursor)'

      visit_var_declaration(cursor)
      ^~~~~~~~~~~~~~~~~~~~~

in src/crystal_lib/parser.cr:100: instantiating 'type(Clang::Type)'

    type = type(cursor.type)
           ^~~~

in src/crystal_lib/parser.cr:270: type must be CrystalLib::Type+, not (CrystalLib::Type | Nil)

    arg_types = Array(Type).new(type.num_arg_types) { |index| type(type.arg_type(index)) }
                                                    ^

Rerun with --error-trace to show a complete error trace.
bararchy commented 7 years ago

Working with HEAD.