Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't compile on linux 0.7.0 #597

Closed
kostya opened this issue Apr 30, 2015 · 8 comments
Closed

can't compile on linux 0.7.0 #597

kostya opened this issue Apr 30, 2015 · 8 comments

Comments

@kostya
Copy link
Contributor

kostya commented Apr 30, 2015

crystal eval 'p 1'
/home/kostya/crystal-0.7.0-1/bin/../embedded/lib/../lib/libevent.a(event.o): In function `detect_monotonic':
event.c:(.text+0xca2): undefined reference to `clock_gettime'
/home/kostya/crystal-0.7.0-1/bin/../embedded/lib/../lib/libevent.a(event.o): In function `gettime':
event.c:(.text+0xd86): undefined reference to `clock_gettime'
collect2: выполнение ld завершилось с кодом возврата 1

may be because of gcc

@kostya
Copy link
Contributor Author

kostya commented Apr 30, 2015

it compiles with -lrt -levent if i change it to -levent -lrt fixed.

@asterite
Copy link
Member

Oh... :-(

Can you confirm that changing the order of the @[Link] declarations here fixes the problem? If so, I'll shortly release 0.7.1.

@jhass
Copy link
Member

jhass commented Apr 30, 2015

I can't confirm the issue over here.

@asterite
Copy link
Member

Yes, on my trusty64 VM it doesn't happen neither...

@kostya
Copy link
Contributor Author

kostya commented Apr 30, 2015

can't confirm because can't recompile compiler, but changing the order in console fixed it.

cc -o 1 main.o -L /home/kostya/crystal-0.7.0-1/embedded/lib/  -lrt -levent -lpcl -lpcre -lgc -lpthread -lunwind 
/home/kostya/crystal-0.7.0-1/embedded/lib//libevent.a(event.o): In function `detect_monotonic':
event.c:(.text+0xca2): undefined reference to `clock_gettime'
/home/kostya/crystal-0.7.0-1/embedded/lib//libevent.a(event.o): In function `gettime':
event.c:(.text+0xd86): undefined reference to `clock_gettime'
collect2: выполнение ld завершилось с кодом возврата 1
cc -o 1 main.o -L /home/kostya/crystal-0.7.0-1/embedded/lib/ -levent -lrt -lpcl -lpcre -lgc -lpthread -lunwind
ok

@asterite
Copy link
Member

So which order is the one that works? rt event or event rt?

@kostya
Copy link
Contributor Author

kostya commented Apr 30, 2015

-levent -lrt works with gcc
with clang order no matter.

@asterite
Copy link
Member

asterite commented May 1, 2015

I just released 0.7.1 because I think gcc might be the default for many linuxes so it's better that this always works. @kostya let me know if it works well now. Thanks for reporting, as always :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants