Using cygwin I am trying to compile a program. Here is my makefile:
SRCDIR := src
OBJDIR := obj
ICODIR := ico
SRC := $(wildcard $(SRCDIR)/*.cpp)
OBJ := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SRC))
ICO := $(ICODIR)/ico.res
CXXFLAGS := -std=c++17 -s -O2 -mwindows
LDFLAGS := -l sfml-graphics-s -l sfml-window-s -l sfml-system-s -lopengl32 -l freetype -lwinmm -lgdi32 -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
INCFLAGS := -I /cygdrive/c/SFML-2.5.1/include -I include
LIBFLAGS := -L /cygdrive/c/SFML-2.5.1
DEFINES := -DSFML_STATIC
.PHONY: test clean
bin/bongo.exe: $(OBJ) $(ICO)
$(CXX) -o $@ $^ $(DEFINES) $(INCFLAGS) $(LIBFLAGS) $(CXXFLAGS) $(LDFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) -c -o $@ $^ $(DEFINES) $(INCFLAGS) $(LIBFLAGS) $(CXXFLAGS) $(LDFLAGS)
$(ICODIR)/ico.res: $(ICODIR)/ico.rc
windres -O coff -o $@ $^
test:
bin/bongo.exe
clean:
rm $(OBJ)
And the error that follows when I execute make
:
$ make
g++ -o bin/bongo.exe obj/ctb.o obj/data.o obj/jsoncpp.o obj/main.o obj/mania.o obj/osu.o obj/taiko.o ico/ico.res -DSFML_STATIC -I /cygdrive/c/SFML-2.5.1/include -I include -L /cygdrive/c/SFML-2.5.1 -std=c++17 -s -O2 -mwindows -l sfml-graphics-s -l sfml-window-s -l sfml-system-s -lopengl32 -l freetype -lwinmm -lgdi32 -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsfml-graphics-s
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsfml-window-s
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsfml-system-s
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lfreetype
collect2: error: ld returned 1 exit status
make: *** [Makefile:16: bin/bongo.exe] Error 1```
I am unsure on where or how to place the libs so they can be found.