make: execvp: gcc: Permission denied

18,158

The problem is that you haven't installed the full Development tools. I encountered the same issue and solved it by installing the Development tools (including gcc)

yum groupinstall "Development Tools"

Share:
18,158
kevin ver
Author by

kevin ver

Updated on June 04, 2022

Comments

  • kevin ver
    kevin ver almost 2 years

    I am trying to make a file using make -f Makefile but I am getting this error:

    root@kevin-VirtualBox:/home/kevin/Desktop/makef# sudo -s make -f Makefile
    gcc -c -o obj/main.o main.c -I./
    make: execvp: gcc: Permission denied
    make: *** [obj/main.o] Error 127
    

    -- Make file code:

    IDIR =./
    CC=gcc
    CFLAGS=-I$(IDIR)
    
    ODIR=obj
    LDIR =./
    
    LIBS=-lgd -lrt
    
    _DEPS = main.h Makefile
    DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
    
    _OBJ = main.o serial.o fb.o menu_main.o timer.o cmdin.o buzzer.o statemachine.o inout.o network.o text_file_input.o text_file_input_oven.o
    OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
    
    
    $(ODIR)/%.o: %.c $(DEPS)
        $(CC) -c -o $@ $< $(CFLAGS)
    
    main: $(OBJ)
        gcc -o $@ $^ $(CFLAGS) $(LIBS)
    
    .PHONY: clean
    
    clean:
        rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~ 
    

    Error after running the gcc program:

    root@kevin-VirtualBox://home/kevin/Desktop/makef# make -f Makefile
    gcc -c -o obj/main.o main.c -I./
    make: execvp: gcc: Permission denied
    make: *** [obj/main.o] Error 127
    root@kevin-VirtualBox://home/kevin/Desktop/makef# make -f Makefile
    gcc -c -o obj/main.o main.c -I./
    make: gcc: Command not found
    make: *** [obj/main.o] Error 127
    root@kevin-VirtualBox://home/kevin/Desktop/makef# mv gcc gcOld^C
    root@kevin-VirtualBox://home/kevin/Desktop/makef# make -f Makefile
    gcc -c -o obj/main.o main.c -I./
    gcc -c -o obj/serial.o serial.c -I./
    gcc -c -o obj/fb.o fb.c -I./
    gcc -c -o obj/menu_main.o menu_main.c -I./
    gcc -c -o obj/timer.o timer.c -I./
    gcc -c -o obj/cmdin.o cmdin.c -I./
    cmdin.c: In function ‘processcmd’:
    cmdin.c:65:4: warning: format ‘%f’ expects argument of type ‘float *’, but argument 4 has type ‘int *’ [-Wformat]
    gcc -c -o obj/buzzer.o buzzer.c -I./
    gcc -c -o obj/statemachine.o statemachine.c -I./
    gcc -c -o obj/inout.o inout.c -I./
    gcc -c -o obj/network.o network.c -I./
    gcc -c -o obj/text_file_input.o text_file_input.c -I./
    text_file_input.c: In function ‘text_file_input’:
    text_file_input.c:43:3: warning: format not a string literal and no format arguments [-Wformat-security]
    text_file_input.c:44:3: warning: format not a string literal and no format arguments [-Wformat-security]
    text_file_input.c:45:3: warning: format not a string literal and no format arguments [-Wformat-security]
    text_file_input.c:175:5: warning: format not a string literal and no format arguments [-Wformat-security]
    gcc -c -o obj/text_file_input_oven.o text_file_input_oven.c -I./
    text_file_input_oven.c: In function ‘text_file_input_oven’:
    text_file_input_oven.c:43:3: warning: format not a string literal and no format arguments [-Wformat-security]
    text_file_input_oven.c:44:3: warning: format not a string literal and no format arguments [-Wformat-security]
    text_file_input_oven.c:45:3: warning: format not a string literal and no format arguments [-Wformat-security]
    text_file_input_oven.c:112:5: warning: format not a string literal and no format arguments [-Wformat-security]
    gcc -o main obj/main.o obj/serial.o obj/fb.o obj/menu_main.o obj/timer.o obj/cmdin.o obj/buzzer.o obj/statemachine.o obj/inout.o obj/network.o obj/text_file_input.o obj/text_file_input_oven.o -I./ -lgd -lrt
    /usr/bin/ld: cannot find -lgd
    collect2: ld returned 1 exit status
    make: *** [main] Error 1