主要使用过时的课程

时间:2013-10-24 18:57:06

标签: c++ makefile

我的主要使用的类方法已过时。我已经更新了cout到终端的方法,但没有显示任何内容。我在方法调用之前和之后放了一个cout,并且正在打印它们。这让我觉得我在编写错误。

我附上了Makefile:

RM = rm -f
SRCPATH = .
SRC = actors/actor.h  controllers/AiController.h controllers/Controller.h \
controllers/PlayerController.h states/BrawlState.h states/DrinkState.h \
states/IdleState.h states/IStateCallback.h states/MineState.h \
states/SingState.h states/SleepState.h states/state.h states/statemachine.h \
resources/dynamicarray.h resources/hashmap.h resources/hashnode.h \
resources/heap.h resources/queue.h resources/stack.h resources/vector3d.h
TESTNAME = test
TESTSRC = main.cpp
#
retest: re test

clean:
    -$(RM) *.o
    -$(RM) *~
    -$(RM) \#*
    -$(RM) *.core
    -$(RM) *.gch

fclean: clean
    -$(RM) $(TESTNAME)

re: fclean

test: 
    g++ $(SRC) $(TESTSRC) -Wall -Werror -std=c++0x -o $(TESTNAME)

1 个答案:

答案 0 :(得分:1)

您需要使test目标依赖于所有源文件和标头,以便在下次运行make test时,其中任何一个的更改都会触发重新编译:

test: $(TESTSRC) $(SRC)
    g++ $(SRC) $(TESTSRC) -Wall -Werror -std=c++0x -o $(TESTNAME)