Makefile problem

This is a discussion on Makefile problem within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm trying to use a makefile, but for some reason I am receiving this error: "make: *** No rule ...

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    66

    Makefile problem

    Hi, I'm trying to use a makefile, but for some reason I am receiving this error:
    "make: *** No rule to make target `main.oo', needed by `main.o'. Stop."

    I am puzzled, because I've had to previously use makefile and I used that as a template. They appear to be the same (except this one had only one .cc and .h file each) and the previous one worked.

    Code:
    lines: line.o main.o
            g++ line.o main.o -o lines
    
    line.o: line.cc line.h
            g++ -c line.cc
    
    main.o: main.oo line.h
            g++ -c main.cc

  2. #2
    Making mistakes
    Join Date
    Dec 2008
    Posts
    476
    main.o: main.cc line.h

    You put oo instead of cc. That's the problem.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    66
    Ack!

    What a rubbish mistake. Thank you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. problem with Makefile separator
    By luca in forum Tech Board
    Replies: 6
    Last Post: 01-15-2007, 09:20 AM
  3. Problem with makefile, how to use the -lm oh this?
    By Nazgulled in forum C Programming
    Replies: 1
    Last Post: 04-07-2006, 01:29 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  5. Replies: 5
    Last Post: 11-07-2005, 10:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21