我知道以前很多人都问过这个问题,但我一直无法解决。我想在eclipse中调试一个makefile项目,但我不能。我刚学c++,不知道makefile怎么写,但是老师给了我一个用,我贴在下面了。我该如何解决这个错误?
另外,如果对你们有任何帮助,我只想调试 DijkstraTest.cpp 主函数,而不是任何其他的。
# first name a variable objects for all object files
# FOR strauss
#CXX = CC
objectsqueue = LinkedList.o
objectstestqueue = QueueTests.o
objectsheap = BinaryHeap.o
objectstestheap = BinaryHeapTest.o
objectsdijkstra = CSV.o Network.o Dijkstra.o
objectstestdijkstra = DijkstraTest.o
# name a variable sources for all source files
sourcesqueue = LinkedList.cpp
sourcestestqueue = QueueTests.cpp
sourcesheap = BinaryHeap.cpp
sourcestestheap = BinaryHeapTest.cpp
sourcesdijkstra = CSV.cpp Network.cpp Dijkstra.cpp
sourcestestdijkstra = DijkstraTest.cpp
# now make default target all exe files
all: testqueue testheap testdijkstra
# list the dependencies for object files - those header files which help build objects
LinkedList.cpp: Collection.h Stack.h Queue.h
QueueTests.o: QueueTests.cpp LinkedList.cpp
BinaryHeap.o: BinaryHeap.h
BinaryHeapTest.o: BinaryHeap.h
Dijkstra.o: CSV.h Dijkstra.h Network.h BinaryHeap.h
# how to build all object files from all dependent source files
$(objectsqueue): $(sourcesqueue)
$(CXX) -c $(sourcesqueue) $(INCLUDES)
$(objectstestqueue): $(sourcestestqueue)
$(CXX) -c $(sourcestestqueue) $(INCLUDES)
$(objectsheap): $(sourcesheap)
$(CXX) -c $(sourcesheap) $(INCLUDES)
$(objectstestheap): $(sourcestestheap)
$(CXX) -c $(sourcestestheap) $(INCLUDES)
$(objectsdijkstra): $(sourcesdijkstra)
$(CXX) -c $(sourcesdijkstra) $(INCLUDES)
$(objectstestdijkstra): $(sourcestestdijkstra)
$(CXX) -c $(sourcestestdijkstra) $(INCLUDES)
clean:
rm -f *.o
rm -f *.exe
testqueue: $(objectsqueue) $(objectstestqueue)
$(CXX) -o QueueTests.exe $(objectsqueue) $(objectstestqueue)
testheap: $(objectsheap) $(objectstestheap)
$(CXX) -o BinaryHeapTest.exe $(objectsheap) $(objectstestheap)
testdijkstra: $(objectsheap) $(objectsdijkstra) $(objectstestdijkstra)
$(CXX) -o DijkstraTest.exe $(objectsheap) $(objectsdijkstra) $(objectstestdijkstra)