title: make: *** [.o] Error 1
body: <p>I get this error: </p>
  
  <pre><code>make all 
  Building file: ../src/lol.c
  Invoking: GCC C Compiler
  gcc -lm lol.c -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/lol.d" -MT"src/lol.d" -o "src/lol.o" "../src/lol.c"
  gcc: error: lol.c: No such file or directory
  make: *** [src/lol.o] Error 1 
  </code></pre>
  
  <p>MAKEFILE </p>
  
  <pre><code>################################################################################
      # Automatically-generated file. Do not edit!
      ################################################################################
  
      -include ../makefile.init
  
      RM := rm -rf
  
      # All of the sources participating in the build are defined here
      -include sources.mk
      -include src/subdir.mk
      -include subdir.mk
      -include objects.mk
  
      ifneq ($(MAKECMDGOALS),clean)
      ifneq ($(strip $(C_DEPS)),)
      -include $(C_DEPS)
      endif
      endif
  
      -include ../makefile.defs
  
      # Add inputs and outputs from these tool invocations to the build variables 
  
      # All Target
      all: lol
  
      # Tool invocations
      lol: $(OBJS) $(USER_OBJS)
          @echo 'Building target: $@'
          @echo 'Invoking: GCC C Linker'
          gcc  -o "lol" $(OBJS) $(USER_OBJS) $(LIBS)
          @echo 'Finished building target: $@'
          @echo ' '
  
      # Other Targets
      clean:
          -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) lol
          -@echo ' '
  
      .PHONY: all clean dependents
      .SECONDARY:
  
      -include ../makefile.targets
  </code></pre>
  
  <p>SUBDIR.mk</p>
  
  <pre><code>################################################################################
  # Automatically-generated file. Do not edit!
  ################################################################################
  
  # Add inputs and outputs from these tool invocations to the build variables 
  C_SRCS += \
  ../src/lol.c 
  
  OBJS += \
  ./src/lol.o 
  
  C_DEPS += \
  ./src/lol.d 
  
  
  # Each subdirectory must supply rules for building sources it contributes
  src/%.o: ../src/%.c
      @echo 'Building file: $&lt;'
      @echo 'Invoking: GCC C Compiler'
      gcc -lm lol.c -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$&lt;"
      @echo 'Finished building: $&lt;'
      @echo ' '
  </code></pre>
  
  <p>when I try to compile the code below. I use eclipse on ubuntu 14.04lts. I know you'll probably need more details bout the error but I don't know what and how, please just ask if you need further information.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  /* to be compiled with "gcc -lm 05_09.c" */
  
  double calculateCharges(float hours);
  
  int main(void)
  {
  
  
      float car_a_hours, car_b_hours, car_c_hours, tothours;
      float car_a_charge, car_b_charge, car_c_charge, totcharge;
  
      printf("\n\n");
  
      printf("enter car #1 parking hours: ");
      scanf("%f", &amp;car_a_hours);
      printf("enter car #2 parking hours: ");
      scanf("%f", &amp;car_b_hours);
      printf("enter car #3 parking hours: ");
      scanf("%f", &amp;car_c_hours);
  
      tothours = car_a_hours + car_b_hours + car_c_hours;
  
      car_a_charge = calculateCharges(car_a_hours);
      car_b_charge = calculateCharges(car_b_hours);
      car_c_charge = calculateCharges(car_c_hours);
  
      totcharge = car_a_charge + car_b_charge + car_c_charge;
  
      printf("\n\n");
  
      printf("Car\tHours\tCharge\n");
      printf("%d\t%5.1f\t%6.2f\n", 1, car_a_hours, car_a_charge);
      printf("%d\t%5.1f\t%6.2f\n", 2, car_b_hours, car_b_charge);
      printf("%d\t%5.1f\t%6.2f\n", 3, car_c_hours, car_c_charge);
      printf("TOTAL\t%5.1f\t%6.2f\n", tothours, totcharge);
  
      printf("\n\n");
  
      return 0;
  
  }
  
  
  double calculateCharges(float hours)
  {
      if ((hours - 3.0) &lt;= 0)
      return 2.0;
      else if ((hours == 24.0))
      return 10;
      else
      return (ceil(hours) - 3) * 0.5 + 2;
  }
  </code></pre>