c++ - make: execvp: gcc: Permission denied -
i trying make file using make -f makefile getting 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 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 *’, 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 string literal , no format arguments [-wformat-security] text_file_input.c:44:3: warning: format not string literal , no format arguments [-wformat-security] text_file_input.c:45:3: warning: format not string literal , no format arguments [-wformat-security] text_file_input.c:175:5: warning: format not string literal , 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 string literal , no format arguments [-wformat-security] text_file_input_oven.c:44:3: warning: format not string literal , no format arguments [-wformat-security] text_file_input_oven.c:45:3: warning: format not string literal , no format arguments [-wformat-security] text_file_input_oven.c:112:5: warning: format not string literal , 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
the problem haven't installed full development tools. encountered same issue , solved installing development tools (including gcc)
yum groupinstall "development tools"
Comments
Post a Comment