maiha/crt.cr

Build issue on Crystal 0.18.4

Closed this issue · 2 comments

Looks like its todo with building it as static however i do have these libraries installed.

[brian@orville crt.cr]$ make
crystal compile --release examples/hello.cr -o bin/hello --link-flags "-static"
/usr/bin/ld: cannot find -lrt
/usr/bin/ld: cannot find -lncursesw
/usr/bin/ld: cannot find -lgpm
/data2/crystal-0.18.6-1/embedded/lib/../lib/libevent.a(evutil.o): In function test_for_getaddrinfo_hacks': evutil.c:(.text+0x1488): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /data2/crystal-0.18.6-1/embedded/lib/../lib/libevent.a(evutil.o): In functionevutil_unparse_protoname':
evutil.c:(.text+0xf0d): warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: cc -o "/data2/Projects/crt.cr/bin/hello" "${@}" -static -rdynamic -lpcre -lgc -lpthread /data2/crystal-0.18.6-1/src/ext/libcrystal.a -levent -lrt -lncursesw -lgpm -ldl -L/usr/lib -L/usr/local/lib
Makefile:17: recipe for target 'hello' failed

maiha commented

Hi, Brian!
I've just pushed dynamic build version as a trial.
But it will not resolve the problem cause I guess you are in os x.
If so, could you try osx branch?

I'm on Arch Linux actually but that seems to fix it thanks !