Makefile error: No such file or directory
Someone please tell me why this Makefile is getting an error.
The Makefile, error message, and directory listing follow.
Thank you.
Makefile:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
OBJS = obj/main.o obj/file1.o obj/file2.o
main.exe : $(OBJS)
g++ -o main.exe $(OBJS)
obj/main.o : main.cpp
g++ -c $@ $<
obj/file1.o : file1.cpp file1.h
g++ -c $@ $<
obj/file2.o : ../lib/file2.cpp ../lib/file2.h
g++ -c $@ $<
|
g++ make error message:
1 2 3 4
|
D:\wolf\Documents\teensy\demo_make\src>make
g++ -c obj/file1.o file1.cpp
g++: error: obj/file1.o: No such file or directory
make: *** [obj/file1.o] Error 1
|
directory structure (Makefile is in /src)
1 2 3 4 5 6 7 8 9 10 11 12
|
D:\wolf\Documents\teensy\demo_make>ls -R
.:
a.exe lib src
./lib:
file2.cpp file2.cpp~ file2.h file2.h~
./src:
Makefile Makefile~ file1.cpp~ file1.h~ main.cpp~ obj
Makefile - Copy file1.cpp file1.h main.cpp main.exe
./src/obj:
|
1 2
|
//g++ -c obj/file1.o file1.cpp
g++ -c file1.cpp -o obj/file1.o
|
Last edited on
Topic archived. No new replies allowed.