my problems with MAKEFILE command

Hi everyone. I'm a newbies in using c++ in UNIX. And since then I only do maintenance coding not development. so far i understand c++ coding and OOP concepts.

currently i'm working onsomething for maintenance purpose.here's the situation :
below are my files :
source files:
advDisc.cpp -- contains the main method
AdvDiscCtrl.cpp -- contains class implementation
AppLog.cpp -- source for writing application log
ErrLog.cpp -- to write error log if any
ITConversion.cpp -- codes for conversion of units n so on
Config.cpp

header files
AdvDiscCtrl.h -- contains class definition
AppLog.h -- contains definition for AppLog.cpp
ErrLog.h -- contains definition for ErrLog.cpp
Config.h -- database configuration n so on..

my makefile.jrnl contains the object of :
advDisc.o Config.o AppLog.o ErrLog.o ITConversion.o AdvDiscCtrl.o

all: advDisc

my problem is when i add new methods in my AdvDiscCtrl.cpp along with in AdvDiscCtrl.h files, there is nothing wrong in compilation. no errors. but i cant call the methods from my main. nothing happen. i mean no output as expected.

fyi, my new new methods are the same as defined before but i only change its name n into which table it is suppose to insert the output. it went well if i exclude my new methods. got the output.
i am so so do not understand why it doesn't run my new methods. i've been stuck with this for a few weeks... :frowning: :confused: please help me.. thanx a lot.. :slight_smile:

<but i cant call the methods from my main. nothing happen. i mean no output as expected.>
what does it mean, what happens if you call the method, does it give you run time error or what. Why dont you add cout statements in your functions to see the flow of your program and see if ur debug messages are printed on the screen.
if not then probably your program is not even getting compiled after your changes.

If this is what I think it is, what's happening is that the listed dependencies are not complete.

When you change one of your header files, every cpp file that includes that header file, directly or indirectly, must be recompiled to be made aware of the changes you've made in the header. But the only dependencies your makefile sees are that, if something.cpp changes, it must rebuild something.o.

Try adding more dependencies in your makefile:

something.o:include1.h include2.h include3.h
someotherthing.o:include2.h
somethingelse.o:include3.h
# etc

That way, when changes happen to the listed include files, it will know it has to rebuild those object files.