I have just installed GLFW on OS X 10.9. The headers were installed to /usr/local/include and the library was installed in /usr/local/lib.
I am wondering what else I would have to do to get my C++ program to include the headers like #include "GLFW/glfw3.h" rather than specifying the whole path like #include "usr/local/include/GLFW/glfw3.h".
Same thing goes for the library because as of now I can't even link the library using -lglfw3. Thanks in advance.
You would pass -I /usr/local/include to the compiler as preprocessor flag, and -L /usr/local/lib to the compiler as linker flag. So to build a single source application small.cc compile it as
g++ -Wall -I /usr/local/include -L /usr/local/lib \
small.cc -o small -lglfw3
If building with make just have
CXXFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
in your Makefile
If using shared libraries, add once /usr/local/lib to /etc/ld.so.conf and run ldconfig (at least on Linux).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With