Thread: MakeFile example

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    24

    MakeFile example

    I am trying to set up a makefile for use with GNU make for the first time:

    My program has the following files:
    myprog.cpp
    myprog.h

    Then I want to make an object file and include it from these files:
    test.cpp
    test.h

    Here is my makefile:
    Code:
    myprog : myprog.o test.o
    
    myprog.o: myprog.cpp myprog.h
    
    test.o: test.cpp test.h
    Is this correct?

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    24
    When I run make.exe, it says this:

    Code:
    C:\Project>make
    cc   myprog.o   -o myprog
    process_begin: CreateProcess(NULL, cc myprog.o -o myprog, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [myprog] Error 2

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile errors
    By Akalic in forum C Programming
    Replies: 2
    Last Post: 12-07-2009, 10:30 AM
  2. Makefile help please
    By TriKri in forum C++ Programming
    Replies: 3
    Last Post: 09-24-2009, 12:36 AM
  3. Replies: 2
    Last Post: 08-11-2009, 06:45 AM
  4. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 11:50 PM
  5. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM