I'm having somewhat of an issue with building my SFML project. I am on Mac OSX.
It is building and running just fine, but only if I have the lib folder under /usr/local/lib. I don't want this dependency. I want to just be able to run the program on its own, referencing the lib folder that it builds from. Here is my makefile:
CC = clang++
C_FLAGS = -Wall
INCLUDE_PATH = include/
LIB_PATH = lib/
LIBS = -lsfml-system -lsfml-graphics -lsfml-window -lsfml-audio
all: collector
collector: Main.o
$(CC) -o collector Main.o -L$(LIB_PATH) $(LIBS)
Main.o: Main.cpp
$(CC) -c Main.cpp -o Main.o -I$(INCLUDE_PATH)
clean:
rm -f collector *.o
With this makefile, it compiles with the includes in my project folders include/ directory, and the libs in my project folders lib/ directory. However, when it comes to running, it will only run if, like I said before, I have the lib folder in /usr/local/. If it is not there, I get this error:
dyld: Library not loaded: @rpath/libsfml-system.2.3.dylib
How do I fix this? I do not want to use the Frameworks, so please don't point me to those.
Also, I understand that SFML requires some external dependencies that I have placed in Library/Frameworks. Is there any way to move those into my project directory for building as well? I just want to have all SFML files tied to my project, hands down.