WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: wmctrl for Pure64  (Read 1584 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
wmctrl for Pure64
« on: November 06, 2019, 10:19:17 PM »
I'm trying to contribute a wmctrl extension (source code here), but am having a tough time compiling it on Pure64 10.1.

configure step gives me a warning I'm not sure what to do with, and make fails with many errors like undefined reference to `g_foo'

Here's what I'm doing:

Code: [Select]
$ tce-load -wi compiletc glib2-dev libX11-dev libXmu-dev
$ cd wmctrl-1.07
$ export CFLAGS="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include"
$ ./configure --prefix=/usr/local
---snip---
checking for GLIB - version >= 2.0.0...
*** 'pkg-config --modversion glib-2.0' returned 2.60.6, but GLIB (2.56.1)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
no
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands

$ make
---snip---
gcc -Wall -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include   -o wmctrl  main.o -lSM -lICE -lX11 -lXmu   
/usr/local/bin/ld: main.o: in function `init_charset':
main.c:(.text+0x461): undefined reference to `g_ascii_strup'
/usr/local/bin/ld: main.c:(.text+0x494): undefined reference to `g_ascii_strup'
/usr/local/bin/ld: main.c:(.text+0x4ab): undefined reference to `g_get_charset'
/usr/local/bin/ld: main.c:(.text+0x539): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x545): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `get_output_str':
main.c:(.text+0x717): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x743): undefined reference to `g_locale_to_utf8'
/usr/local/bin/ld: main.c:(.text+0x786): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x7b5): undefined reference to `g_locale_from_utf8'
/usr/local/bin/ld: main.c:(.text+0x7f4): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x806): undefined reference to `g_strdup'
/usr/local/bin/ld: main.o: in function `wm_info':
main.c:(.text+0xbf2): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0xbfe): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0xc0a): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0xc16): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0xc22): undefined reference to `g_free'
/usr/local/bin/ld: main.o:main.c:(.text+0xc2e): more undefined references to `g_free' follow
/usr/local/bin/ld: main.o: in function `window_set_title':
main.c:(.text+0xfc1): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0xff2): undefined reference to `g_locale_to_utf8'
/usr/local/bin/ld: main.c:(.text+0x1009): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x1019): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x11d5): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x11e1): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `window_to_desktop':
main.c:(.text+0x12c7): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `activate_window':
main.c:(.text+0x142a): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `window_state':
main.c:(.text+0x1633): undefined reference to `g_ascii_strup'
/usr/local/bin/ld: main.c:(.text+0x164d): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x16a0): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x16ac): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x16f2): undefined reference to `g_ascii_strup'
/usr/local/bin/ld: main.c:(.text+0x170c): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x175f): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x176b): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `wm_supports':
main.c:(.text+0x1893): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x18bc): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `action_window_str':
main.c:(.text+0x1f32): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x1f4c): undefined reference to `g_utf8_casefold'
/usr/local/bin/ld: main.c:(.text+0x1f78): undefined reference to `g_locale_to_utf8'
/usr/local/bin/ld: main.c:(.text+0x1f92): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x1fa9): undefined reference to `g_utf8_casefold'
/usr/local/bin/ld: main.c:(.text+0x1fd6): undefined reference to `g_utf8_casefold'
/usr/local/bin/ld: main.c:(.text+0x2044): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2050): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x205c): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2068): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2076): undefined reference to `g_free'
/usr/local/bin/ld: main.o:main.c:(.text+0x2082): more undefined references to `g_free' follow
/usr/local/bin/ld: main.o: in function `list_desktops':
main.c:(.text+0x2574): undefined reference to `g_malloc0'
/usr/local/bin/ld: main.c:(.text+0x2640): undefined reference to `g_malloc0'
/usr/local/bin/ld: main.c:(.text+0x26db): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x27a0): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x27c4): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x280b): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x283b): undefined reference to `g_malloc0'
/usr/local/bin/ld: main.c:(.text+0x28e8): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x290c): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x29ad): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x29d1): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x2a18): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x2a48): undefined reference to `g_malloc0'
/usr/local/bin/ld: main.c:(.text+0x2b11): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x2b35): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x2c1b): undefined reference to `g_strdup_printf'
/usr/local/bin/ld: main.c:(.text+0x2c3f): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x2c86): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x2dbe): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2e46): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2e52): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2e5e): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2e6a): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2e76): undefined reference to `g_strfreev'
/usr/local/bin/ld: main.c:(.text+0x2e82): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2e8e): undefined reference to `g_strfreev'
/usr/local/bin/ld: main.c:(.text+0x2e9a): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x2ea6): undefined reference to `g_strfreev'
/usr/local/bin/ld: main.c:(.text+0x2eb2): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `list_windows':
main.c:(.text+0x30d5): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x33fa): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x3406): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x3412): undefined reference to `g_free'
/usr/local/bin/ld: main.o:main.c:(.text+0x341e): more undefined references to `g_free' follow
/usr/local/bin/ld: main.o: in function `get_window_class':
main.c:(.text+0x350b): undefined reference to `g_locale_to_utf8'
/usr/local/bin/ld: main.c:(.text+0x3525): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `get_window_title':
main.c:(.text+0x35aa): undefined reference to `g_strdup'
/usr/local/bin/ld: main.c:(.text+0x35da): undefined reference to `g_locale_to_utf8'
/usr/local/bin/ld: main.c:(.text+0x35f4): undefined reference to `g_free'
/usr/local/bin/ld: main.c:(.text+0x3600): undefined reference to `g_free'
/usr/local/bin/ld: main.o: in function `get_property':
main.c:(.text+0x3729): undefined reference to `g_malloc'
/usr/local/bin/ld: main.o: in function `get_active_window':
main.c:(.text+0x39f7): undefined reference to `g_free'
collect2: error: ld returned 1 exit status
make: *** [Makefile:200: wmctrl] Error 1

I already found this, but it didn't help much:

I'd like to successfully compile wmctrl. What am I missing or doing wrong?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11691
Re: wmctrl for Pure64
« Reply #1 on: November 06, 2019, 11:56:38 PM »
Hi GNUser
Code: [Select]
---snip---
checking for GLIB - version >= 2.0.0...
*** 'pkg-config --modversion glib-2.0' returned 2.60.6, but GLIB (2.56.1)
*** was found! If pkg-config was correct, then it is best
---snip---
According to:
http://tinycorelinux.net/10.x/x86_64/tcz/glib2.tcz.info
it says:
Code: [Select]
Current: 2019/08/12 updated 2.56.1 -> 2.60.6Use the  Apps  utility to check for updates. The  undefined reference to  errors are probably because it's not linking to  glib2.
« Last Edit: November 07, 2019, 07:30:39 AM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14843
Re: wmctrl for Pure64
« Reply #2 on: November 07, 2019, 12:53:11 AM »
wmctrl extension posted in CorePure64 repo

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: wmctrl for Pure64
« Reply #3 on: November 07, 2019, 08:15:30 AM »
Thank you, Rich. It was trivial to compile wmctrl after updating glib2-dev. It seems I let my build tools get out of sync. Rookie mistake :-[

Thank you, juanito!