主要使用过时的类

Main using outdated classes

本文关键字:过时      更新时间:2023-10-16

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

我已经附上了我的制作文件:

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)
您需要

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

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