You are not logged in.

#1 2021-11-22 13:10:07

shako
Member
Registered: 2021-11-16
Posts: 50

glib.h: no such file or directory

Hi everyone!

I am trying to compile the surf browser, which I downloaded directly from the suckless website. However, trying to install it via "sudo make clean install" gives me:

fatal error: glib.h: no such file or directory

How do I overcome this? I installed glib2 but it didn't help. I also have the glib.h file in /usr/include/glib-2.0/, maybe it is not found by the surf Makefile since it is not in its "standard" location?

Thanks in advance smile

Last edited by shako (2021-11-22 13:12:14)

Offline

#2 2021-11-22 13:14:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,645

Re: glib.h: no such file or directory

You'd normally run a make without install at first to actually do the build, and this is unlikely to be the entire output. Post the entire output. In any case, any particular reason you are trying to do this that way instead of using the AUR package: https://aur.archlinux.org/packages/surf ?

Last edited by V1del (2021-11-22 13:16:27)

Offline

#3 2021-11-22 13:19:12

shako
Member
Registered: 2021-11-16
Posts: 50

Re: glib.h: no such file or directory

Here is the output of make:

surf build options:
CC            = c99
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.0', 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
Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.0', required by 'virtual:world', not found
Package 'webkit2gtk-web-extension-4.0', required by 'virtual:world', not found
WEBEXTCFLAGS  = -fPIC  -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 webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.0', 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

Also, here is the output of "pkg-config --cflags --libs glib2.0":

-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0
V1del wrote:

any particular reason you are trying to do this that way instead of using the AUR package: https://aur.archlinux.org/packages/surf ?

I generally keep dwm, surf, slock and dmenu in a folder in my home directory just because I find it easier to patch them and sync them with my forks on GitHub. I find it convenient and "clean", but I am still a newbie so I might be wrong! smile

Last edited by shako (2021-11-22 13:44:41)

Offline

#4 2021-11-22 14:38:10

seth
Member
Registered: 2012-09-03
Posts: 50,960

Re: glib.h: no such file or directory

Sanity check:

pacman -Qikk glib2
stat /usr/include/glib-2.0/glib.h

Also

Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.0', required by 'virtual:world', not found

Offline

#5 2021-11-22 14:46:02

arojas
Developer
From: Spain
Registered: 2011-10-09
Posts: 2,097

Re: glib.h: no such file or directory

shako wrote:

Package webkit2gtk-4.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit2gtk-4.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'webkit2gtk-4.0', required by 'virtual:world', not found

That's the actual issue, it makes the whole

pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0

command fail. The output of

pkg-config --cflags --libs glib2.0

is irrelevant, that is nowhere used in the compiler command.

Offline

#6 2021-11-22 14:56:11

shako
Member
Registered: 2021-11-16
Posts: 50

Re: glib.h: no such file or directory

arojas wrote:

That's the actual issue, it makes the whole

pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0

command fail.

That was it! It was sufficient to install the webkit2gtk package to fix everything. Thanks a lot @arojas smile

Offline

Board footer

Powered by FluxBB