Open hemantasapkota opened 6 years ago
For those struggling to build for osx ( High Sierra ), these instructions might be helpful:
Install dependencies
brew install premake brew install glfw3 brew install gnu-sed
Replace all occurrences of glfw3 to glfw
gsed -i "s/{ \"glfw3\" }/{ \"glfw\" }/g" premake4.lua
Generate Build
premake4 gmake
Build
cd build make
When I run make
, i got
`==== Building nanovg (debug_native) ====
==== Building example_gl2 (debug_native) ====
demo.c
../example/demo.c:8:10: fatal error: 'GLFW/glfw3.h' file not found
^~~~~~~~~~~~~~
1 error generated. make[1]: [obj/native/Debug/example_gl2/demo.o] Error 1 make: [example_gl2] Error 2`
For starters I would try brew ls glfw3
and see where the headers are.
Then add the parent folder of GLFW
with -isystem <incdir>
to the Makefile
CFLAGS
. That should work, until you get to the linker. Then do the a similiar search for the library and use -L <libdir>
in LDFLAGS
.
I had issues with this, too. Here's what worked for me:
brew install premake glfw
premake5 gmake
cd build
CFLAGS="-I/opt/homebrew/Cellar/glfw/3.3.8/include" \
LDFLAGS="-L/opt/homebrew/Cellar/glfw/3.3.8/lib" \
make nanovg
For those struggling to build for osx ( High Sierra ), these instructions might be helpful:
Install dependencies
Replace all occurrences of glfw3 to glfw
Generate Build
Build