Hi,
PROBLEM:I am trying to statically link my project so I can send it to my friend (dynamically linking works fine but I wont want to have to install sfml on their computer) but I am getting a symbol not defined linker error.
WHAT I HAVE DONE: I created a folder called lib_sfml_static where i put 4 static libraries such as libsfml-system-s.a inside. I am using the following flags to indicate i want to do static linking:
-D SFML_STATIC -Llib_sfml_static -lsfml-system-s -lsfml-window-s -lsfml-audio-s -lsfml-graphics-s
I thought that the symbol not defined error means that I'm missing header files so I also tried copying the header files to another folder and adding another include directive -Isfml_static_headers but this seemed to not work, and I read online that I shouldn't actually have to specify headers with static libraries.
GITHUBHere is the github link of the project, make snake-stat is the command that I run to make statically versus dynamically.
https://github.com/zjschrage/Snake/blob/main/src/Makefile