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

How to run on linux #5

Open
ghost opened this issue Apr 13, 2017 · 11 comments
Open

How to run on linux #5

ghost opened this issue Apr 13, 2017 · 11 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2017

Hi
Write more the process of running programs using the library libui.cr on linux (ubuntu)

@refi64
Copy link

refi64 commented Apr 13, 2017

You mean...like this?

https://github.com/Fusion/libui.cr/blob/master/README.md#development

The instructions are already for OSX and Linux.

@ghost
Copy link
Author

ghost commented Apr 14, 2017

@kirbyfan64 This instruction is unclear

@Fusion
Copy link
Owner

Fusion commented Apr 15, 2017

Sergiy,

What part of the instructions, specifically, do you find unclear? If you share with us where you are stuck, this will allow me to update the documentation accordingly.

@tzekid
Copy link

tzekid commented Apr 17, 2017

@Yenel
The documentation on libui's page is fuzzy.
The static linking in crystal didn't work (as I expected).

I haven't found an 'easy-way' of installing libui on a fresh install of ubuntu.
The only way I've found is to download, build and install the libui and libpcre libraries.
The process (in my experience was/) is a bit tedious.

Here's a little script I wrote that more or less automates this process (tested on a fresh install of Ubuntu 17.04)

@nedpals
Copy link

nedpals commented May 27, 2017

@tzekid I followed your script but it appears it has conflicts with the dependencies
/usr/bin/ld: warning: libpcre.so.3, needed by //lib/x86_64-linux-gnu/libglib-2.0.so.0, may conflict with libpcre.so.1

I'm using 16.04 btw

@tzekid
Copy link

tzekid commented May 27, 2017

@nedpals Can you give out a bit more info please ?
e.g. Did you get any errors / warnings whilst following the script ? How did you get the warning ? etc.

@nedpals
Copy link

nedpals commented May 30, 2017

@tzekid Nevermind, it was just a warning. Works fine except on compiling it shows that warning. Btw your script is fine except when copying libraries. It throws an error having no "out" folder when copying libui.

@tzekid
Copy link

tzekid commented May 30, 2017

@nedpals Ok. Thanks. Fixed it :)

@ddrscott
Copy link

on OSX I get the following:

% crystal build --link-flags "-L$(PWD)" src/examples/controlgallery/main.cr
ld: library not found for -lui
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc -o "/Users/scott.pierce/git/libui.cr/main" "${@}" -L/Users/scott.pierce/git/libui.cr -rdynamic  -lui -lpcre -lgc -lpthread /usr/local/Cellar/crystal-lang/0.22.0/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/lib -L/usr/local/lib`

@tzekid
Copy link

tzekid commented Jun 22, 2017

@ddrscott: Crystal doesn't recognize libui on your system. You need to build it.

@rubyFeedback
Copy link

rubyFeedback commented Aug 20, 2022

You need to build it.

Not sure.

The ruby gem comes with the bindings for osx and windows so it just works there.

Perhaps a crystal shard could have the same and support it. Perhaps even on
windows now? The above comment is ~5 years old so perhaps things improved
a lot meanwhile.

Edit: For those unaware, I referred to kojix2' bindings in ruby here:

https://github.com/kojix2/LibUI

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

6 participants