Description
I installed cmake, built and installed raylib into ~/opt/raylib/
, and built pkg-config but reached a "local minima" down the rabbit hole.
pkg-config doesn't know anything about raylib so just running ./build.sh
from this point doesn't work:
nn.h % ./build.sh
+ CFLAGS='-O3 -Wall -Wextra -I./thirdparty/'
+ LIBS=-lm
+ clang -O3 -Wall -Wextra -I./thirdparty/ -o adder_gen adder_gen.c -lm
++ pkg-config --cflags raylib
Package raylib was not found in the pkg-config search path.
Perhaps you should add the directory containing `raylib.pc'
to the PKG_CONFIG_PATH environment variable
No package 'raylib' found
++ pkg-config --libs raylib
Package raylib was not found in the pkg-config search path.
Perhaps you should add the directory containing `raylib.pc'
to the PKG_CONFIG_PATH environment variable
No package 'raylib' found
+ clang -O3 -Wall -Wextra -I./thirdparty/ -o xor xor.c -lm -lglfw -ldl -lpthread
In file included from xor.c:3:
./nn.h:71:10: fatal error: 'raylib.h' file not found
#include "raylib.h"
^~~~~~~~~~
1 error generated.
At this branch of the rabbit hole I don't know how to make pkg-config know about raylib so I tried to manually construct a working commandline but don't really know what I'm doing. For instance:
nn.h % clang -O3 -Wall -Wextra -I./thirdparty/ -I~/opt/raylib -o xor xor.c -lm -lglfw -ldl -lpthread -lraylib
In file included from xor.c:3:
./nn.h:71:10: fatal error: 'raylib.h' file not found
#include "raylib.h"
^~~~~~~~~~
1 error generated.
I figured this is not somewhere ~
works and got further:
nn.h % clang -O3 -Wall -Wextra -I./thirdparty/ -I$HOME/opt/raylib/include -o xor xor.c -lm -lglfw -ldl -lpthread -lraylib -L$HOME/opt/raylib/lib
ld: library not found for -lglfw
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm assuming at this point glfw is a free OpenGL library that Linux comes with and macOS does not.
If I figure this out myself I'll post my answer. But if somebody who actually knows what they're doing on macOS can post the steps I'm sure I'm not the only dummy who'll benefit.