why does gcc (installed via brew) not recognize glib (also installed via brew)?

64 Views Asked by At

test.c

#include <glib.h>
int main() {}
// test program to verify glib can be included
brew update
brew install gcc
brew install glib
gcc-13 test.c

I get this error.

test.c:5:10: fatal error: glib.h: No such file or directory
    5 | #include <glib.h>
      |          ^~~~~~~~
compilation terminated.

I tried specifiying include and linking directories but no luck

gcc-13 test.c -I /opt/homebrew/lib/glib-2.0/include/ /opt/homebrew/include/glib-2.0/ -L /opt/homebrew/lib/glib-2.0/
0

There are 0 best solutions below