crystal-lang / crystal_lib

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

libuv: Couldn't import type: uv__io_t (Exception) #57

Open vladfaust opened 5 years ago

vladfaust commented 5 years ago

Given examples/libuv.cr:

@[Include("uv.h", prefix: %w(uv_))]
@[Link("uv")]
lib LibUV
end
$ crystal src/main.cr -- examples/lib
Unhandled exception: Couldn't import type: uv__io_t (Exception)
  from src/crystal_lib/type_mapper.cr:190:5 in 'map_internal'
  from src/crystal_lib/type_mapper.cr:34:36 in 'map_non_recursive'
  from src/crystal_lib/type_mapper.cr:72:5 in 'map_internal'
  from src/crystal_lib/type_mapper.cr:34:36 in 'map_non_recursive'
  from src/crystal_lib/type_mapper.cr:72:5 in 'map_internal'
  from src/crystal_lib/type_mapper.cr:34:36 in 'map_non_recursive'
  from src/crystal_lib/type_mapper.cr:30:35 in 'map'
  from src/crystal_lib/type_mapper.cr:250:15 in 'expand_pending_structs'
  from src/crystal_lib/type_mapper.cr:30:35 in 'map'
  from src/crystal_lib/type_mapper.cr:250:15 in 'expand_pending_structs'
  from src/crystal_lib/type_mapper.cr:30:35 in 'map'
  from src/crystal_lib/prefix_importer.cr:75:5 in 'process'
  from src/crystal_lib/prefix_importer.cr:5:7 in 'import'
  from src/crystal_lib/lib_transformer.cr:24:7 in 'transform'
  from /usr/share/crystal/src/compiler/crystal/syntax/transformer.cr:7:14 in 'transform'
  from /usr/share/crystal/src/compiler/crystal/syntax/transformer.cr:23:19 in 'transform'
  from /usr/share/crystal/src/compiler/crystal/syntax/transformer.cr:7:14 in 'transform'
  from src/main.cr:5:1 in '__crystal_main'
  from /usr/share/crystal/src/crystal/main.cr:97:5 in 'main_user_code'
  from /usr/share/crystal/src/crystal/main.cr:86:7 in 'main'
  from /usr/share/crystal/src/crystal/main.cr:106:3 in 'main'
  from __libc_start_main
  from _start
  from ???
olbat commented 4 years ago

Looks like it's fixed by https://github.com/crystal-lang/crystal_lib/pull/65 .