Go Back   The UNIX and Linux Forums > Top Forums > Programming
Search Forums:



Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-28-2005
Registered User
 

Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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... please help me.. thanx a lot..

Sponsored Links
    #2  
Old 12-28-2005
linuxpenguin's Avatar
Registered User
 

Join Date: May 2002
Location: India
Posts: 326
Thanks: 0
Thanked 1 Time in 1 Post
<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.
Sponsored Links
    #3  
Old 12-28-2005
Moderator
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 12,127
Thanks: 230
Thanked 1,686 Times in 1,618 Posts
Quote:
Originally Posted by aliasunway
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.
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:
Code:
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.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problems with find command lodey UNIX for Dummies Questions & Answers 4 10-27-2007 07:47 AM
Problems with tar command lo-lp-kl AIX 2 05-16-2007 02:19 AM
system command and threads problems german83 AIX 2 04-21-2007 11:57 AM
CC command problems jpeery Programming 1 08-02-2004 01:34 PM
Problems with expr command rooh UNIX for Dummies Questions & Answers 2 01-17-2003 10:03 AM



All times are GMT -4. The time now is 12:19 AM.