mer-hybris / libgbinder

GLib-style interface to binder
BSD 3-Clause "New" or "Revised" License
50 stars 42 forks source link

Can't compile using make: fatal error: gutil_types.h: No such file or directory #116

Closed iguanajuice closed 1 year ago

iguanajuice commented 1 year ago

Downloaded from this tag: https://github.com/mer-hybris/libgbinder/releases/tag/1.1.34

Full compilation error: make: pkg-config: No such file or directory cc -c -fPIC -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED -Wall -Wstrict-aliasing -Wunused-result -Iinclude -MMD -MP -g -DDEBUG -MT"build/debug/gbinder_bridge.o" -MF"build/debug/gbinder_bridge.d" src/gbinder_bridge.c -o build/debug/gbinder_bridge.o In file included from include/gbinder_local_request.h:36, from src/gbinder_bridge.c:33: include/gbinder_types.h:36:10: fatal error: gutil_types.h: No such file or directory 36 | #include <gutil_types.h> | ^~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:266: build/debug/gbinder_bridge.o] Error 1

monich commented 1 year ago

Sounds like libglibutil-dev (or libglibutil-devel depending on your distro) package is missing. Some distros include it, some don't. If yours doesn't have it then you have to compile it from the source.

Required dependencies are listed in spec and control files.

Also note that LIBGLIBUTIL_PATH environment variable allows side-by-side linking with libglibutil, i.e. without installing the development package. See Makefile for details.

iguanajuice commented 1 year ago

New discovery; this does seem like an issue on my end.

For context: I have a laptop and desktop computer, both running Arch and are up to date. I only have trouble compiling on my laptop. They both do not have libglibutil-dev/el, but do have libglibutil. The laptop got it from chaotic-aur, and the desktop didn't. If I try to install libglibuitl from the normal AUR, it throws this error, but only on my laptop: include/gutil_types.h:36:10: fatal error: glib.h: No such file or directory

I tried diagnosing this problem further by creating a basic C program that just includes glib.h (which I have installed on both systems as packages glib2 and lib32-glib2) and prints '1'. Running gcc throws this error on both devices: include/gutil_types.h:36:10: fatal error: glib.h: No such file or directory which is very weird since my desktop had no problems with compilation, but is seemingly having the same issue when including glib.h. Looking up online, it says I'm supposed to add option -I/usr/include/glib-2.0, but trying again on both systems throws this error instead: /usr/include/glib-2.0/glib/gtypes.h:34:10: fatal error: glibconfig.h: No such file or directory

So in conclusion: Both devices seemingly have the same packages, and got the same errors when trying to compile my test program, yet I can install libglibutil from the AUR on one device just fine but not on the other. Sweet.