Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-09-2005, 12:18 AM   #1
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:

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
g++ -c -g timeTest.cpp -o timeTest.cpp
g++ -c -g time.cpp -o time.o

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

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
There are a couple things amiss... Try:
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, 01:13 AM   #3
LQ Newbie
Registered: Dec 2005
Posts: 4

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


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 03:31 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 04:57 AM
Another problem with Makefile lucs Slackware 3 02-14-2005 06:06 PM
Problem with Makefile lucs Slackware 7 02-11-2005 10:18 AM
generate Makefile from without calling ./configure ? chris78 Programming 2 05-02-2004 01:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:31 PM.

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