Updated Answer
Try to find a file called GraphicsMagick-config in the directory where you installed GraphicsMagick as follows:
find /usr -name "GraphicsMagick-config"
When you find this, you can ask him to tell you that the compiler flags and linker flags are included:
/usr/some/path/GraphicsMagick-config
Then you can compile with:
gcc $(/usr/some/path/GraphicsMagick-config --cflags --libs) somefile.c -o somefile
Original answer
Look at the directory where you installed GraphicsMagick for the file ending in .pc , which is the pkg-config file, for example
find /usr/local -iname "graphic*.pc"
Then pass this file to pkg-config to get the CFLAGS and LIBS that you should use to compile. So if your graphicsmagick.pc is in /usr/local/Cellar/graphicsmagick/1.3.23/lib/pkgconfig/GraphicsMagick.pc , use:
pkg-config --cflags --libs /usr/local/Cellar/graphicsmagick/1.3.23/lib/pkgconfig/GraphicsMagick.pc
which will give you the following:
/usr/local/Cellar/graphicsmagick/1.3.23/lib/pkgconfig/GraphicsMagick.pc -I/usr/local/Cellar/graphicsmagick/1.3.23/include/GraphicsMagick -L/usr/local/Cellar/graphicsmagick/1.3.23/lib -lGraphicsMagick
Then you compile with:
gcc $(pkg-config --cflags --libs somefile.c -o somefile
Mark setchell
source share