Originally Posted by
vart
Where are your CXX, CXXFLAGS and RM variables defined?
Yes they are defined by default.
This works :
PHP Code:
target = main
CPPFLAGS += -Wall -Wextra -g
libs=lsmfl-window -lsmfl-graphics
LDFLAGS+=$(libs)
$(target):main
$(CXX) $(LDGLAGS) $^ -o $@
main.o : main.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
.PHONY:clean
clean:
$(RM) -f *.o $(target)
This doesn't :
PHP Code:
target = main
linker=ld
CPPFLAGS += -Wall -Wextra -g
libs=lsmfl-window -lsmfl-graphics
LDFLAGS+=$(libs)
$(target):main.o
$(linker) $(LDGLAGS) $^ -o $@
main.o: main.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
.PHONY:clean
clean: $(RM) -f *.o $(target)
So I got with the first one.I guess ld doesn.t link to libC++ by default