C++: Creating a makefile with two executables? C++
问题 I have two C++ programs that both share a class. progOne.cpp and progTwo.cpp. They both share a class, fileInfo.cpp with the appropriate fileInfo.h file. This is how I tried to create the makefile. all: progOne.cpp progTwo.cpp progOne: progOne.cpp fileInfo.cpp g++ progOne.cpp fileinfo.cpp -o progOne progTwo: progTwo.cpp fileinfo.cpp g++ progTwo.cpp fileinfo.cpp -o progTwo. I get the error: make: nothing to be done for 'all'. 回答1: You need: all: progOne progTwo This tells make that all depends