Studying Computer Science on Unix platform is ussually fun expect days when you get stuck.
And life get tough, this is one of my tough days.
To make life easier with my c++ programming I wanted to use the make tool under unix.
I have 5 fieles :
- studgrp.h depend on student.h
- demo.cc depend on studgrp.h
- studgrp.cc depend on studgrp.h
- student.cc depend on studgrp.h
So using emacs I typed this small script
record: demo.o studgrp.o student.o g++ demo.o studgrp.o sudent.o -o record studgrp.o: studrgp.h studrgp.cc g++ -c studrgp.cc student.o: studgrp.h student.cc g++ -c student.cc demo.o: studrgp.h demo.cc g++ -c demo.cc
And i got this error message
make record make: *** No rule to make target `studrgp.h', needed by `demo.o'. Stop.
I think the proble is with student.h because this file is not checked for any changes durring dewelopment of my work. Basic notes from my tutor says this about using make tool:
- if you change a header, any .cc file that depends on that header must be recompiled
- if you change a .cc file, that must be recompiled
But what about the relationship between studgrp.h and student.h?