uing icon indicating copy to clipboard operation
uing copied to clipboard

Please Help, unable compile the example code

Open zhouhm opened this issue 10 months ago • 2 comments

root@uvew:~/uing/examples# nim c -d:useLibUiStaticLib --passL:"-I/root/libui/include -I/usr/include/gtk-3.0" --passC:"-L/root/libui/lib/x86_64-linux-gnu" datetime.nim
Hint: used config file '/root/nim-2.0.2/config/nim.cfg' [Conf]
Hint: used config file '/root/nim-2.0.2/config/config.nims' [Conf]
Hint: used config file '/root/uing/examples/nim.cfg' [Conf]
.................................................................................................
/root/uing/uing/rawui.nim(132, 1) Warning: '{.deadcodeelim: on.}' is deprecated, now a noop [Deprecated]
/root/uing/uing.nim(633, 35) Warning: r, g, b, a all have default value '1.0', this may be unintentional, either use ';' (semicolon) or explicitly write each default value [ImplicitDefaultValue]
/root/uing/uing.nim(2448, 32) Warning: r, g, b, alpha all have default value '1.0', this may be unintentional, either use ';' (semicolon) or explicitly write each default value [ImplicitDefaultValue]
/root/uing/uing.nim(3399, 14) Warning: use `dateTime`; initDateTime is deprecated [Deprecated]
Hint:  [Link]
/usr/bin/ld: libui.a(unix_alloc.c.o): in function `uninitComplain':
alloc.c:(.text+0x26): undefined reference to `g_strdup_printf'
/usr/bin/ld: alloc.c:(.text+0x31): undefined reference to `g_free'
/usr/bin/ld: alloc.c:(.text+0x4d): undefined reference to `g_strdup'
/usr/bin/ld: libui.a(unix_alloc.c.o): in function `uiprivInitAlloc':
alloc.c:(.text+0x69): undefined reference to `g_ptr_array_new'
/usr/bin/ld: libui.a(unix_alloc.c.o): in function `uiprivUninitAlloc':
alloc.c:(.text+0xb9): undefined reference to `g_ptr_array_foreach'
/usr/bin/ld: alloc.c:(.text+0xe9): undefined reference to `g_free'
/usr/bin/ld: alloc.c:(.text+0x10e): undefined reference to `g_ptr_array_free'
...
/usr/bin/ld: window.c:(.text+0xb10): undefined reference to `g_signal_connect_data'
/usr/bin/ld: window.c:(.text+0xb59): undefined reference to `g_object_ref'
/usr/bin/ld: window.c:(.text+0xb8c): undefined reference to `gtk_container_add'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowSetContainer':
window.c:(.text+0x12c): undefined reference to `gtk_container_remove'
/usr/bin/ld: window.c:(.text+0x135): undefined reference to `gtk_container_add'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowDisable':
window.c:(.text+0x17e): undefined reference to `gtk_widget_set_sensitive'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowEnable':
window.c:(.text+0x1a1): undefined reference to `gtk_widget_set_sensitive'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowEnabled':
window.c:(.text+0x1bc): undefined reference to `gtk_widget_get_sensitive'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowHide':
window.c:(.text+0x1d3): undefined reference to `gtk_widget_hide'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowShow':
window.c:(.text+0x1ec): undefined reference to `gtk_window_present'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowVisible':
window.c:(.text+0x1fc): undefined reference to `gtk_widget_get_visible'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowSetTitle':
window.c:(.text+0x2cc): undefined reference to `gtk_window_set_title'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowPosition':
window.c:(.text+0x2dc): undefined reference to `gtk_window_get_position'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowSetFullscreen':
window.c:(.text+0x5e6): undefined reference to `gtk_window_fullscreen'
/usr/bin/ld: window.c:(.text+0x5f1): undefined reference to `gtk_window_unfullscreen'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowSetBorderless':
window.c:(.text+0x6b6): undefined reference to `gtk_window_set_decorated'
/usr/bin/ld: libui.a(unix_window.c.o): in function `uiWindowSetResizeable':
window.c:(.text+0x7c9): undefined reference to `gtk_window_set_resizable'
/usr/bin/ld: libui.a(unix_util.c.o): in function `uiprivSetMargined':
util.c:(.text+0xe): undefined reference to `gtk_container_set_border_width'
/usr/bin/ld: util.c:(.text+0x1b): undefined reference to `gtk_container_set_border_width'
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc   -o /root/uing/examples/datetime  /root/.cache/nim/datetime_r/@m..@[email protected]@slib@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@slib@sstd@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@slib@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@slib@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@slib@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@slib@[email protected] /root/.cache/nim/datetime_r/@m..@[email protected]@slib@[email protected] /root/.cache/nim/datetime_r/@[email protected] /root/.cache/nim/datetime_r/@mdatetime.nim.c.o  -pthread -pthread -lm -lm -lrt libui.a  -I/root/libui/include -I/usr/include/gtk-3.0  -ldl'

zhouhm avatar Apr 06 '24 03:04 zhouhm

This doesn't seem like an issue with the wrapper, and more like the functions in libui being unable to find GTK functions. I don't know how to help with this issue.

neroist avatar Apr 17 '24 07:04 neroist

Does static compilation or using -d:useLibUiDll not work for you?

neroist avatar Apr 17 '24 07:04 neroist

Three months without a response, closing.

neroist avatar Jul 20 '24 12:07 neroist