You are not logged in.

#1 2021-08-01 23:23:49

wnaBee
Member
Registered: 2021-06-19
Posts: 12

[SOLVED] glib can't be found, despite being in use on machine

I'm trying to compile surf by suckless, running make i get the following error:

surf build options:
CC            = c99
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gcr-3', required by 'virtual:world', not found
CFLAGS        = -fPIC   -DVERSION="2.1" -DGCR_API_SUBJECT_TO_CHANGE  -DLIBPREFIX="/usr/local/lib" -DWEBEXTDIR="/usr/local/lib/surf"  -D_DEFAULT_SOURCE -O1
WEBEXTCFLAGS  = -fPIC -I/usr/include/webkitgtk-4.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -pthread  -O1
LDFLAGS       =
c99 -fPIC `pkg-config --cflags x11` `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` -DVERSION=\"2.1\" -DGCR_API_SUBJECT_TO_CHANGE  -DLIBPREFIX=\"/usr/local/lib\" -DWEBEXTDIR=\"/usr/local/lib/surf\"  -D_DEFAULT_SOURCE -O1 -c surf.c
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gcr-3', required by 'virtual:world', not found
surf.c:9:10: fatal error: glib.h: No such file or directory
    9 | #include <glib.h>
      |          ^~~~~~~~
compilation terminated.
make: *** [Makefile:31: surf.o] Error 1

I figured out that make can't find glib at usr/include/glib-2.0 or /usr/lib/glib-2.0/include however checking there shows that glib is in fact installed. So i changed <glib.h> to <glib-2.0/glib.h>, this solved the issue but now make instead returned:

surf build options:
CC            = c99
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gcr-3', required by 'virtual:world', not found
CFLAGS        = -fPIC   -DVERSION="2.1" -DGCR_API_SUBJECT_TO_CHANGE  -DLIBPREFIX="/usr/local/lib" -DWEBEXTDIR="/usr/local/lib/surf"  -D_DEFAULT_SOURCE -O1
WEBEXTCFLAGS  = -fPIC -I/usr/include/webkitgtk-4.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -pthread  -O1
LDFLAGS       =
c99 -fPIC `pkg-config --cflags x11` `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` -DVERSION=\"2.1\" -DGCR_API_SUBJECT_TO_CHANGE  -DLIBPREFIX=\"/usr/local/lib\" -DWEBEXTDIR=\"/usr/local/lib/surf\"  -D_DEFAULT_SOURCE -O1 -c surf.c
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gcr-3', required by 'virtual:world', not found
In file included from surf.c:9:
/usr/include/glib-2.0/glib.h:30:10: fatal error: glib/galloca.h: No such file or directory
   30 | #include <glib/galloca.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:31: surf.o] Error 1

Which means that glib can't find itself for compilation. Strangely however it is being used for other programs installed on the system.
My question then is, how can i change the cflag to find glib so that i don't have to manually add glib-2.0/ to every single #include.

P.S. this is a brand new Vbox machine arch install running dwm (if that's relevant).

Last edited by wnaBee (2021-08-02 10:48:01)


I know nothing.

Offline

#2 2021-08-01 23:39:52

lmn
Member
Registered: 2021-05-09
Posts: 68

Re: [SOLVED] glib can't be found, despite being in use on machine

You can add the cflags and the clibs to the config.mk inside the build directory, instead of patching the includes directly.

You can list all targets by

pkg-config --list-all

and then look for glib.

I was too hasty, your missing a depenency  on gcr, see the AUR package for more.

Last edited by lmn (2021-08-01 23:48:18)

Offline

#3 2021-08-02 01:00:17

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,411
Website

Re: [SOLVED] glib can't be found, despite being in use on machine

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2021-08-02 10:47:39

wnaBee
Member
Registered: 2021-06-19
Posts: 12

Re: [SOLVED] glib can't be found, despite being in use on machine

lmn wrote:

You can add the cflags and the clibs to the config.mk inside the build directory, instead of patching the includes directly.

You can list all targets by

pkg-config --list-all

and then look for glib.

I was too hasty, your missing a depenency  on gcr, see the AUR package for more.

Aaah, i see i installed gcr and it compiled fine, big thanks!
Always remember your dependencies! big_smile

Last edited by wnaBee (2021-08-02 10:48:33)


I know nothing.

Offline

#5 2023-04-14 16:21:31

josh68
Member
Registered: 2023-04-14
Posts: 27

Re: [SOLVED] glib can't be found, despite being in use on machine

I'm having this problem, and installing gcr isn't the issue

Output of

pkg-config --list-all
xmlsec1-openssl   xmlsec1-openssl - XML Security Library implements XML Signature and XML Encryption standards
xmlsec1           xmlsec1-openssl - XML Security Library implements XML Signature and XML Encryption standards
libevent_core     libevent_core - libevent_core
ncurses           ncursesw - ncurses 6.3 library
ncursesw          ncursesw - ncurses 6.3 library
menu              menuw - ncurses 6.3 add-on library
bdw-gc            Boehm-Demers-Weiser Conservative Garbage Collector - A garbage collector for C and C++
nss               NSS - Mozilla Network Security Services
gpg-error         gpg-error - GPG Runtime
xmlsec1-gcrypt    xmlsec1-gcrypt - XML Security Library implements XML Signature and XML Encryption standards
nspr              NSPR - The Netscape Portable Runtime
nettle            Nettle - Nettle low-level cryptographic library (symmetric algorithms)
p11-kit-1         p11-kit - Library and proxy module for properly loading and sharing PKCS
gmpxx             GNU MP C++ - GNU Multiple Precision Arithmetic Library (C++ bindings)
panelw            panelw - ncurses 6.3 add-on library
libpskc           Libpskc - Library for Portable Symmetric Key Container
libxml-2.0        libXML - libXML library version2.
stoken            stoken - Software token
hogweed           Hogweed - Nettle low-level cryptographic library (public-key algorithms)
ncurses++w        ncurses++w - ncurses 6.3 add-on library
guile-3.0         GNU Guile - GNU's Ubiquitous Intelligent Language for Extension
libidn2           libidn2 - Library implementing IDNA2008 and TR46
libffi            libffi - Library supporting Foreign Function Interfaces
gmp               GNU MP - GNU Multiple Precision Arithmetic Library
panel             panelw - ncurses 6.3 add-on library
libevent_openssl  libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent
sqlite3           SQLite - SQL database engine
libcrypto         OpenSSL-libcrypto - OpenSSL cryptography library
openssl           OpenSSL - Secure Sockets Layer and cryptography libraries and tools
libgcrypt         libgcrypt - General purpose cryptographic library
jemalloc          jemalloc - A general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.
autoopts          AutoOpts - A semi-automated generated/library option parser
libevent_extra    libevent_extra - libevent_extra
libssl            OpenSSL-libssl - Secure Sockets Layer and cryptography libraries
expat             expat - expat XML parser
gnutls-dane       GnuTLS-DANE - DANE security library for the GNU system
libnghttp2        libnghttp2 - HTTP/2 C library
xmlsec1-gnutls    xmlsec1-gnutls - XML Security Library implements XML Signature and XML Encryption standards
liboath           Liboath - Library for Open AuTHentication (OATH) HOTP etc support.
zlib              zlib - zlib compression library
gnutls            GnuTLS - Transport Security Layer implementation for the GNU system
libevent_pthreads libevent_pthreads - libevent_pthreads adds pthreads-based threading support to libevent
menuw             menuw - ncurses 6.3 add-on library
form              formw - ncurses 6.3 add-on library
openconnect       openconnect - OpenConnect VPN client
libcares          c-ares - asynchronous DNS lookup library
readline          Readline - Gnu Readline library for command line editing
libevent          libevent - libevent is an asynchronous notification event loop library
formw             formw - ncurses 6.3 add-on library
libunbound        unbound - Library with validating, recursive, and caching DNS resolver
libtasn1          libtasn1 - Library for ASN.1 and DER manipulation

Thanks for any ideas

Offline

#6 2023-04-14 16:24:52

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,093

Re: [SOLVED] glib can't be found, despite being in use on machine

If you had the same issue, installing gcr would be the issue. If that doesn't do it, make a new thread with full logs.

Offline

#7 2023-04-14 16:45:49

josh68
Member
Registered: 2023-04-14
Posts: 27

Re: [SOLVED] glib can't be found, despite being in use on machine

Scimmia wrote:

If you had the same issue, installing gcr would be the issue. If that doesn't do it, make a new thread with full logs.

You're right. My problem is only what's in the title. Currently, it's

checking for GLIB... no
configure: error: Glib >= 2.18.0+ is required

But then

pacman -Q --info glib2
Name            : glib2
Version         : 2.76.1-1
Description     : Low level core library
Architecture    : x86_64
URL             : [url]https://wiki.gnome.org/Projects/GLib[/url]
Licenses        : LGPL
Groups          : None
Provides        : libglib-2.0.so=0-64  libgio-2.0.so=0-64  libgmodule-2.0.so=0-64  libgobject-2.0.so=0-64  libgthread-2.0.so=0-64
Depends On      : libffi  libsysprof-capture  pcre2  util-linux-libs  zlib  libffi.so=8-64  libmount.so=1-64
Optional Deps   : gvfs: most gio functionality [installed]
                  libelf: gresource inspection tool [installed]
                  python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report [installed]
Required By     : accountsservice  at-spi2-core  audacity  avahi  bluez  bluez-utils-compat  cairo  cinnamon-menus  dbus-glib  dbus-python
                  dconf  desktop-file-utils  enchant  flatpak  fprintd  gcab  gcr-4  gdk-pixbuf2  geocode-glib-common  glib-networking
                  glib-perl  glibmm  glyr  gmime3  gnome-autoar  gnome-firmware  gnome-menus  granite  graphene  gsettings-desktop-schemas
                  gsound  gspell  gssdp  gstreamer  gstreamer0.10  gtk3  gtk4  gtkmathview  gts  gupnp  gupnp-dlna  gupnp-igd  harfbuzz
                  irssi  json-glib  lensfun  lib32-glib2  libass  libcheese  libcloudproviders  libcolord  libcroco  libdbusmenu-glib
                  libfm-extra  libgdm  libgee  libgexiv2  libgirepository  libgrss  libgtop  libgudev  libgusb  libgxps  libhandy  libibus
                  libical  liblqr  libmalcontent  libmbim  libmediainfo  libmm-glib  libmypaint  libnautilus-extension  libnice  libnm
                  libnotify  libosinfo  libots  libpamac  libplist-git  libportal  libproxy  libqrtr-glib  libratbag  librest  librsvg
                  libsecret  libsoup  libsoup3  libspeechd  libwacom  libxfce4util  libxklavier  libxmlb  lightdm  loudmouth  modemmanager
                  ostree  pantheon-terminal  pinentry  pipewire  polkit  poppler-glib  pragha  sane  shared-mime-info  totem-pl-parser
                  tracker3  upower  webkit2gtk  webkit2gtk-4.1  webkit2gtk-5.0  wpebackend-fdo  wv  xdg-dbus-proxy  xdg-desktop-portal
                  zoom
Optional For    : libpulse  suil  visual-studio-code-bin
Conflicts With  : None
Replaces        : None
Installed Size  : 23.61 MiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Wed 22 Mar 2023 06:06:39 AM PDT
Install Date    : Mon 10 Apr 2023 11:20:12 PM PDT
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

New thread?

Offline

#8 2023-04-14 20:45:50

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,411
Website

Re: [SOLVED] glib can't be found, despite being in use on machine


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB