0

我主要使用的类方法已过时。我已经更新了 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)
4

1 回答 1

1

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

test: $(TESTSRC) $(SRC)
    g++ $(SRC) $(TESTSRC) -Wall -Werror -std=c++0x -o $(TESTNAME)
于 2013-10-24T19:12:57.660 回答