I want to make simple application using c++ and SDL libraries on mac. When I try to make executable with makefile, my SDl libraries are in the "/Library/Frameworks" directory.
CC = g++
CFLAGS = -c -std=c++23 -g
LDFLAGS = -g -I/opt/homebrew/include/SDL2 -F/Library/Frameworks -framework SDL2 -framework SDL2_ttf -framework SDL2_image
SRC = ${wildcard src/* .cpp}
HDR = ${wildcard include/* .hpp}
OBJ = ${SRC:.c=.o}
EXEC = window_app
all: ${SRC} ${OBJ} ${EXEC}
${EXEC}: ${OBJ}
${CC} ${LDFLAGS} $^ -o $@
%.o: %.c ${HDR}
${CC} ${CFLAGS} $< -o $@
When I run the executable on my computer it works perfect, but when I transfer the executable to another computer, same os, it throws a error on me saying "SDL2, SDL2_ttf and etc..." don't exist on the computer.
I have tried to include the SDL folders into my project and compiling them but they don't work when they are directly inside my project. My question is there a way to compile the libraries with my project? Please and thank you. I am sorry if I am not clear enough, I am new to all of the coding stuff.