Geany doesn't compile projects. You can use a makefile to serve the same purpose; however, you have to make it manually or use an external command that can figure out dependencies. Geany's "make" command will use the make file called "makefile" by default, so you can simply give your make file that name and all should be well.
all: hello
hello: main.o factorial.o hello.o
g++ main.o factorial.o hello.o -o hello
main.o: main.cpp
g++ -c main.cpp
factorial.o: factorial.cpp
g++ -c factorial.cpp
hello.o: hello.cpp
g++ -c hello.cpp
clean:
rm -rf *o hello
Example taken from here. You can find more detailed information on that page as well.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…