make:execvp:gcc:权限被拒绝
make: execvp: gcc: Permission denied
我正试图使用make-f Makefile创建一个文件,但我收到了以下错误:
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
--制作文件代码:
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)/*~
运行gcc程序后出错:
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
问题是您还没有安装完整的开发工具。我遇到了同样的问题,并通过安装开发工具(包括gcc)解决了它
yum-groupinstall"Development Tools"
相关文章:
- Termux权限被拒绝
- AWS Lambda C++运行时权限被拒绝
- 为什么 KMS drmModeSetCrtc() 在 X11 会话中运行时会失败并被拒绝权限?
- 使用崇高文本 3 进行C++拒绝授予权限?
- 安卓inotify_add_watch失败:权限被拒绝?
- clang --版本权限被拒绝错误
- 为什么 mkdir() 后跟 ofstream::operator<< 失败并被拒绝权限?
- QSSLSLSOCKETS无法解决和权限拒绝错误
- 运行简单 c++ 程序时出现权限被拒绝错误
- Apache HTTPD模块共享内存权限拒绝了错误
- CLION无法打开输出文件,拒绝了权限
- 无法打开输出文件___.exe:权限被拒绝
- 写入文件权限被拒绝
- .out 使用 -c 指令和 g++ 拒绝权限
- 当我使用 remove() 时权限被拒绝
- Linux 拒绝使用 boost asio 的套接字绑定权限
- 获取错误 - 启用权限后,OpenProcess() 中的访问被拒绝
- 连接到Boost.Asio创建的域套接字时权限被拒绝
- 无法打开输出文件:binDebugPrimeChecker.exe权限被拒绝
- 在Linux中拒绝权限