my problems with MAKEFILE command


 
Thread Tools Search this Thread
Top Forums Programming my problems with MAKEFILE command
# 1  
Old 12-28-2005
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... Smilie Smilie please help me.. thanx a lot.. Smilie

# 2  
Old 12-28-2005
<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.
# 3  
Old 12-28-2005
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

SunOS 5.5.1 usage of Makefile command in make file

I am new to Solaris and compilation using make files. I have a code base which is organized into different folders. At the root folder is a master make file and in the sub directories, there are make files for that particular folder. In the make files present in subdirectories, I am seeing... (2 Replies)
Discussion started by: rajujayanthy
2 Replies

2. Shell Programming and Scripting

[Solved] Command execution in Makefile

Linux Gurus, I have a query regarding the execution of a complex command in the makefile of the current system. I am currently using shell command in the makefile to execute the command. However my command fails as it is a combination of a many commands and execution collects a huge data...... (4 Replies)
Discussion started by: satishkumar432
4 Replies

3. UNIX for Dummies Questions & Answers

Problems compiling with Makefile

Hey guys! To avoid :wall: for another 5 hours, I'm posting here to hopefully resolve this silly issue once and for all. I'd appreciate if you could simply provide the full makefile I should use, and then explain what does what. I've been studying dissected examples for hours now and none of it's... (3 Replies)
Discussion started by: Liandri
3 Replies

4. Shell Programming and Scripting

bash command in makefile (cygwin)

Hello, In my make file (make 3.81), I use a combination of shell commands to automatically create the name of my build directory. OS := $(shell uname -s) ARCH := $(shell uname -m) KERN := $(shell uname -r | cut -d. -f 1,2) BDIR := $(OS)_$(KERN).$(ARCH)When I boot into different OSs, I... (7 Replies)
Discussion started by: LMHmedchem
7 Replies

5. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

6. UNIX for Advanced & Expert Users

Makefile executing another Makefile first?

I have 2 libraries in 2 different directories that I build with Makefiles. library B depends on library A. If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A? I am now rebuilding A, followed by B... but I'd like B to... (0 Replies)
Discussion started by: wwuster
0 Replies

7. UNIX for Dummies Questions & Answers

Trouble with flex command in makefile

Hey all, im trying to create a makefile in unix. cpp2html is a program created from the files cpp2html.o and lex.yy.o. cpp2html.o is created from compiling cpp2html.c and lex.yy.o is created from another created file lex.yy.c. and lex.yy.c is created from a command "flex cppscanner.l" and here is... (1 Reply)
Discussion started by: iwatk003
1 Replies

8. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

9. AIX

Problems with tar command

Hello Somebody can help me, I try to extract a file by tar command but I get this error message root@mxlgjac/home/bistrain# tar -xvf C57U6ML.tar tar: 0511-169 A directory checksum error on media; 804399312 not equal to 62020. The file in tar format its on the same directory, where I try... (2 Replies)
Discussion started by: lo-lp-kl
2 Replies

10. Programming

CC command problems

Apparently I do not have C on my Sun Blade. It's a fresh install, and I'l fairly new to using this box. When I type cc, I get the following: /usr/ucb/cc: language optional software package not installed... Does this mean I do not have C on this Blade? How can I get it and set it up? Thanks! (1 Reply)
Discussion started by: jpeery
1 Replies
Login or Register to Ask a Question