CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009
    Posts
    9

    Make Files: No rule to make target

    Sorry about this, the file had gone walk abouts. I can't believe I have just done this!

    But I have a new problem... My project compiles

    but when I type executable in the terminal it doesn't run I just get


    bash: executable: command not found








    Hello, I am struggling with make files I really don't understand what is wrong with mine.

    I have 4 files: main.cpp stringTokeniser.hpp Command.hpp Program.hpp

    main.cpp include Program.hpp

    and Program.hpp includes Command.hpp and strinbgTokeniser.hpp

    My make file is as follows but I receive this error:

    make: *** No rule to make target `stringTokeniser.hpp', needed by `Program.o'. Stop.

    Code:
    CC = g++
    
    executable: main.o
    	$(CC) main.o -o executable
    
    main.o: main.cpp Program.o
    	$(CC) -c main.cpp
    
    Program.o: Program.hpp stringTokeniser.hpp Command.hpp
    	$(CC) -c Program.hpp
    I haave also tried

    Code:
    CC = g++
    
    executable: main.o
    	$(CC) main.o -o executable
    
    main.o: main.cpp Program.o Program.hpp stringTokeniser.hpp Command.hpp
    	$(CC) -c main.cpp
    gives this error: make: *** No rule to make target `stringTokeniser.hpp', needed by `main.o'. Stop.



    Can anyone help me along the right path? thanks
    Last edited by emdiesse; December 16th, 2009 at 08:37 PM.

  2. #2
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158

    Re: Make Files: No rule to make target

    ./executable

  3. #3
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,019

    Re: Make Files: No rule to make target

    Is the spelling of stringTokeniser.hpp correct? Is the casing correct?
    Succinct is verbose for terse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured