Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7691375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:36:31+00:00 2026-05-31T20:36:31+00:00

I have three files: movie.h (header); movie.cpp (implementation file); lab9.cpp (driver file using movie

  • 0

I have three files: movie.h (header); movie.cpp (implementation file); lab9.cpp (driver file using movie class)

I was given this sample on how to generate a makefile to compile the above files:

http://sci.tamucc.edu/~ptedford/1436Spr12/1436CommonFiles/MakeFileExample.txt

However, I’m still having trouble grasping the concept here (I don’t even know where to fill in my filenames because the sample file names confuse me (such as: what is main.o supposed to represent here?)).

Can someone help me make sense of this (a solution with an explanation), such that it produces a single executable called lab9?

Edit: I have the following in my makefile:

linkAndRun: lab9.o movie.o
        g++ movie.o lab9.o -o lab9

movie.o: movie.cpp movie.h
        g++ -c movie.cpp -o movie.o

lab9.o: lab9.cpp
        g++ -c lab9.cpp -o lab9.o

I’m getting several compile errors, but the compile itself seems successful. Is this correct? The two answers provided so far both had differences, so I combined what I felt was the correct things. So confirmation would help though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:36:32+00:00Added an answer on May 31, 2026 at 8:36 pm

    Here is what you are looking for-

    executeThis: lab9.o movie.o 
        g++ lab9.o movie.o -o lab9
    
    lab9.o: lab9.cpp
        g++ -c lab9.cpp -o lab.o
    
    movie.o: movie.cpp movie.h
        g++ -c movie.cpp -o movie.o
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three files, a main .cpp file: #include <stdio.h> #include myClass.h int main()
I have the following three files in the same directory: citysim.cpp #include utils.h using
I have three files: one called sql.php witch has a class db that I
Suppose that I have those three files: a.h //a.h header #include <stdio.h> int int_variable;
I have ObservableCollection for my Collection og Movie files. Im using ListView to display
I have the following code in a header only file. #pragma once class error_code
I have three files in a folder 'test' one.php two.php print.html And i have
Say I have three files (template_*.txt): template_x.txt template_y.txt template_z.txt I want to copy them
For example, if I have three ASCII files: file1.txt file2.txt file3.txt ...and I wanted
In Unix, I have got three main files. One of them is a library

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.