You are not logged in.

#1 2021-02-26 16:56:22

aumars
Member
Registered: 2018-01-08
Posts: 23

[SOLVED] glib/gtypes.h not found (Emacs/Flycheck)

I want to parse a key-value file (config file). I chose to use GLib since Linux distributions have it pre-installed.

#include <glib-2.0/glib.h>

The problem is when I try to link the library, I get the following errors on Flycheck:

 glib.h 'glib/galloca.h' file not found with <angled> include; use "quotes" instead (c/c++-clang)
 galloca.h  'glib/gtypes.h' file not found (c/c++-clang)

/usr/include/glib-2.0/glib/gtypes.h does actually exist so I don't know what the problem is

Nothing referencing this error shows up on any search engine so I ask you if you have any idea.

Thanks

Last edited by aumars (2021-02-26 19:10:10)

Offline

#2 2021-02-26 18:24:44

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [SOLVED] glib/gtypes.h not found (Emacs/Flycheck)

You need to add the include paths. See pkgconf --cflags glib-2.0

Offline

#3 2021-02-26 19:09:54

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] glib/gtypes.h not found (Emacs/Flycheck)

I added

(add-hook 'c-mode-hook
        (lambda () (setq flycheck-clang-include-path
                       (list "/usr/include/glib-2.0" "/usr/lib/glib-2.0/include"))))

to my .emacs

Thanks

Offline

#4 2021-03-02 03:57:46

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] glib/gtypes.h not found (Emacs/Flycheck)

Have you also switched from the incorrect <glib-2.0/glib.h> to <glib.h> ?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB