我正在尝试将一个程序从我的cloud9-ide转移到我的覆盆子上。但当我移动它们时,makefile就不再起作用了。
#
# Makefile
#
# Computer Science 50
# Problem Set 5
#
# compiler to use
CC = clang
# flags to pass compiler
CFLAGS = -ggdb3 -O0 -Qunused-arguments -std=c11 -Wall -Werror
# name for executable
EXE = myTest
# space-separated list of header files
HDRS = i2cContinuousRead.h
# space-separated list of libraries, if any,
# each of which should be prefixed with -l
LIBS =
# space-separated list of source files
SRCS = myTest.c i2cContinuousRead.c
# automatically generated list of object files
OBJS = $(SRCS:.c=.o)
# default target
$(EXE): $(OBJS) $(HDRS) Makefile
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS)
# dependencies
$(OBJS): $(HDRS) Makefile
# housekeeping
clean:
rm -f core $(EXE) *.o
我得到错误输出
clang -ggdb3 -Qunused-arguments -std=c11 -Wall -Werror -c -o myTest.o myTest.c
make: clang: Command not found
<builtin>: recipe for target 'myTest.o' failed
make: *** [myTest.o] Error 127
我试着更新sudo apt-get安装构建必需的
我有一个新的安装如果杰西。
有小费吗?
发布于 2016-12-23 13:19:02
不知道为什么要用clang进行编译,但是让CC = gcc在makefile中编译应用程序可以让你用gcc编译应用程序,但是如果你真的需要clang,你可以用
sudo apt-获取安装clang llvm
发布于 2016-12-23 13:24:09
似乎你还没有在你的系统上安装clang。您可以按照e.jahandar的建议安装它,或者使用linux发行版杰西附带的标准gcc编译器。
https://stackoverflow.com/questions/41302107
复制相似问题