crystal-lang / crystal_lib

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

libssh2 #43

Closed bararchy closed 7 years ago

bararchy commented 7 years ago

Lib file:

@[Include(
  "libssh/ssh2.h",
  "libssh/server.h",
  "libssh/libssh.h",
  "libssh/sftp.h",
  "libssh/callbacks.h",
  "libssh2.h",
)]
@[Link("ssh2")]
lib LibSSH
end

Trying to generate the headers I get:

/usr/include/unistd.h:229:10: fatal error: 'stddef.h' file not found
@[Link("ssh2")]
lib LibSSH
end

Did I do something wrong ? did I miss something ?

mverzilli commented 7 years ago

It seems an env issue. What happens if you try to compile and run a file like this?

#include <stddef.h>
#include <stdio.h>

int main() {
  printf("Hello World\n");
}
bararchy commented 7 years ago

@mverzilli Yap, this example in C compiles and runs.

bararchy commented 7 years ago

@mverzilli Found out that in Arch Linux the stddef is under /usr/include/linux/ and not /usr/include/ After creating a symlink were good.

mverzilli commented 7 years ago

Thanks for the follow up! The other day I dowloaded an Arch Linux Docker image to reproduce some of these issues and getting it to a usable state was a PITA. The bleeding edge is exciting, but not for everyone :P.