LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2005, 11:18 PM   #1
LuvMyKelly
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Rep: Reputation: 0
Question Makefile problem


Hey sorry I know there is stuff on this through search but I couldn't find anything that could help me im trying to make a makefile with compiling:
timeTest.cpp
time.cpp
time.h

I'm not really sure how to make it I have this:

program: timeTest.o time.o
g++ -g timeTest.o time.o -o project5
timeTest.o:
g++ -c -g timeTest.cpp -o timeTest.cpp
time.o:
g++ -c -g time.cpp -o time.o

Not sure if its right thanks
 
Old 12-09-2005, 12:08 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
There are a couple things amiss... Try:
Code:
project5: timeTest.o time.o
<tab>g++ -g timeTest.o time.o -o project5

timeTest.o: timeTest.cpp time.h
<tab>g++ -c -g timeTest.cpp

time.o: time.cpp time.h
<tab>g++ -c -g time.cpp
That assumes time.h is needed by both cpp files. Also, <tab> represents an actual tab indention. Spaces won't work. It must be a tab.
 
Old 12-09-2005, 12:13 AM   #3
LuvMyKelly
LQ Newbie
 
Registered: Dec 2005
Posts: 4

Original Poster
Rep: Reputation: 0
all right thanks a bunch!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefile Problem nelnel Programming 4 07-08-2005 02:31 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
Another problem with Makefile lucs Slackware 3 02-14-2005 05:06 PM
Problem with Makefile lucs Slackware 7 02-11-2005 09:18 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM


All times are GMT -5. The time now is 08:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration