I have installed SDL2. I can link my program with
clang++ -lSDL2 -lv8 main.o test.o -o nano8
However, for distributing reasons, I'd like to give SDL2 away with the binary, and hence i've copied libSDL2-2.0.0.dylib under /myapp/lib/libSDL2-2.0.0.dylib As for the documentation, @executable_path should allow me to link to that dylib instead of the one in /usr/local/lib, but if I run
clang++ @executable_path/lib/libSDL2-2.0.0.dylib -lv8 main.o test.o -o nano8
I get the error
clang: error: no such file or directory: '@executable_path/lib/libSDL2-2.0.0.dylib'
How to set the search path for a dylib?