libui.cr icon indicating copy to clipboard operation
libui.cr copied to clipboard

How to run on linux

Open ghost opened this issue 8 years ago • 11 comments

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

ghost avatar Apr 13 '17 11:04 ghost

You mean...like this?

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

The instructions are already for OSX and Linux.

refi64 avatar Apr 13 '17 14:04 refi64

@kirbyfan64 This instruction is unclear

ghost avatar Apr 14 '17 11:04 ghost

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.

Fusion avatar Apr 15 '17 23:04 Fusion

@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)

tzekid avatar Apr 17 '17 13:04 tzekid

@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

nedpals avatar May 27 '17 04:05 nedpals

@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.

tzekid avatar May 27 '17 16:05 tzekid

@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.

nedpals avatar May 30 '17 12:05 nedpals

@nedpals Ok. Thanks. Fixed it :)

tzekid avatar May 30 '17 15:05 tzekid

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`

ddrscott avatar Jun 19 '17 16:06 ddrscott

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

tzekid avatar Jun 22 '17 06:06 tzekid

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

rubyFeedback avatar Aug 20 '22 18:08 rubyFeedback