在我Method.h文件:错误: '方法' 是在此范围内声明
int method();
在我Method.cpp文件:
int method(){....}
在我Main.cpp的文件:
method();
在我的Makefile
EXEC = main
OBJS = Method.o
.PHONY: all
all: $(EXEC)
main: Main.cpp $(OBJS)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -o [email protected]
Method.o : Method.h Method.cpp
当我打电话做,它说,
Main.cpp: In function ‘int menu()’:
Main.cpp:26: error: ‘method’ was not declared in this scope
make: *** [main] Error 1
可有人告诉我哪里错了? 谢谢!
你在你的Main.cpp中是否#include?更完整的代码视图将有所帮助。 –
ypnos
2011-03-02 15:40:33
在选择您最喜欢的答案之前,您是否需要更多信息? :-) – 2011-03-11 21:39:43