vurtun / nuklear

A single-header ANSI C gui library
13.66k stars 1.11k forks source link

Examples won't compile on macOS because it doesn't have pkg-config by default. #916

Open ordnl opened 4 years ago

ordnl commented 4 years ago

In examples/Makefile, GLFW3 is linked through pkg-config

GLFW3 := $(shell pkg-config --libs glfw3)

Unfortunately macOS does not have pkg-config by default, so GLFW3 is not linked, causing a compilation error.

This can be fixed by changing:

LIBS := $(GLFW3) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib

to:

LIBS := -lglfw -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -lm -lGLEW -L/usr/local/lib

This happened on my macOS High Sierra (10.13.6)

dumblob commented 4 years ago

Feel free to make a PR for a change. In this case I'm not sure whether there are some differences between different versions of macOS as we already introduced exceptions for darwin and it worked back then for the people using it (I do have unfortunately just an older macOS notebook, but few hundreds kilometers away from me :wink:).