No such file or directory, confused??

This is a discussion on No such file or directory, confused?? within the C Programming forums, part of the General Programming Boards category; I have the following makefile that should compile a list of source files into an executable. When trying to make, ...

  1. #1
    Registered User TheEngineer's Avatar
    Join Date
    Aug 2009
    Posts
    50

    No such file or directory, confused??

    I have the following makefile that should compile a list of source files into an executable. When trying to make, I get the error shown. I can't understand why I am getting it since all the source files are in the same directory. Any ideas?

    Makefile:
    Code:
    SOURCE_DIR = $(top_srcdir)
    SOURCE_INCLUDE_DIR = $(SOURCE_DIR)/../../include
    SOURCE_COMMON_DIR = $(SOURCE_DIR)/
    SOURCE_LDSCRIPT_DIR = $(SOURCE_DIR)
    
    BUILD_DIR = $(top_builddir)
    BUILD_PROM_DIR = $(BUILD_DIR)
    
    
    CC=gcc
    CFLAGS=-c -Wall
    LDFLAGS=-M -T $(SOURCE_LDSCRIPT_DIR)/Linker.ld  
    SOURCES= Main.c \
             ErrorHandler.c \
             ScriptProcess.c \
             Queues.c \
             Commands.c \
             Processes.c \
    	 Utilities.c \
         	 Executive.s \
    	 time.o \
             $(SOURCE_COMMON_DIR)/Esr.c \
    	 $(SOURCE_COMMON_DIR)/bitset.s
    
    OBJECTS=$(SOURCES:.c=.o)
    EXECUTABLE=Program1
    
    all: $(SOURCES) $(EXECUTABLE)
    	
    $(EXECUTABLE): $(OBJECTS) 
    	$(CC) $(LDFLAGS) $(OBJECTS) -o $@
    
    .c.o:
    	$(CC) $(CFLAGS) $< -o $@
    .s.o:
    	$(CC) $(CFLAGS) $< -o $@

    Error:
    Code:
    $ make
     cd .. && automake-1.10 --gnu  Makefile
     cd . && /bin/sh ./config.status Makefile
    config.status: creating Makefile
    gcc -M -T ../Linker.ld   Main.o ErrorHandler.o ScriptProcess.o Queues.o Commands.o Processes.o Utilities.o Executive.s time.o -o Program1
    gcc: Executive.s: No such file or directory
    gcc: time.o: No such file or directory
    make: *** [Program1] Error 1

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Does "Executive.s" actually exist? How about "time.o"? Is that supposed to be ".c"?


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User TheEngineer's Avatar
    Join Date
    Aug 2009
    Posts
    50
    Quote Originally Posted by quzah View Post
    Does "Executive.s" actually exist? How about "time.o"? Is that supposed to be ".c"?


    Quzah.
    Yeah, that's what is confusing, all the source files are in the same directory and none of the others seem to have a problem compiling

  4. #4
    Registered User TheEngineer's Avatar
    Join Date
    Aug 2009
    Posts
    50
    Fixed for now by adding absolute path to files in directory. Seems like it shouldn't matter, but I'm not getting the error anymore

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    So in other words, they didn't really exist where you thought they were. They weren't with all your .c files.


    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Registered User TheEngineer's Avatar
    Join Date
    Aug 2009
    Posts
    50
    Quote Originally Posted by quzah View Post
    So in other words, they didn't really exist where you thought they were. They weren't with all your .c files.


    Quzah.
    Nope, they were in the same directory as my c files, exactly where I thought they were. All I did was add the path to the exact same folder

  7. #7
    Registered User
    Join Date
    Sep 2009
    Location
    USA
    Posts
    63
    Quote Originally Posted by TheEngineer View Post
    Fixed for now by adding absolute path to files in directory. Seems like it shouldn't matter, but I'm not getting the error anymore

    i think i get the solution for your problem ..when you installed your c compiler did you change your CLASSPATH variable?....bcoz if you install cygwin for example you need to change ur classpath if not ...it throws an error that file not found...agn . U need to change ur CLASSPATH not PATH variable.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 03:49 PM
  3. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  4. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  5. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM

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