0

I am using Doom Emacs as my editor for C. I'm trying to use glib in my C project and for that I'm including glib.h. I have added the include dirs displayed by pkg-config --cflags glib-2.0 to flycheck-clang-include-path, like so:

(add-hook! c-mode
  (setq flycheck-clang-include-path
        (list "/usr/include/glib-2.0"
              "/usr/lib/glib-2.0/include"
              "/usr/include/sysprof-4")))

It displays these paths in customize as well. However I still get the error "'glib.h' file not found" when I do #include <glib.h>. What am I doing wrong, how do I get flycheck to find the header?

0

1 Answer 1

0

So, this wasn't flycheck's fault, I simply hadn't configured the LSP for this project. I did so now by generating a compile_commands.json file using bear. Everything works as expected now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.