【发布时间】:2019-07-01 09:34:48
【问题描述】:
我正在尝试按照Github 上的本指南将 ssd1963 LCD 与 Raspberry Pi3 型号 B+ 连接。
尝试在rpi-tftgl/tftgl 目录中安装为rpi-tftgl 提供的makefile 时,运行make 命令时出现此错误。
这是我捕获的 pi 终端窗口图像的链接,显示了确切的错误:
以下是我执行make 命令时收到的错误:
gcc -c src/tftgl.c -o src/tftgl.o -I/opt/vc/include -I. -Iinclude -D:0 -O3
<command-line>:0:1: error: macro names must be identifiers
Makefile:18: recipe for target 'src/tftgl.o' failed
make: *** [src/tftgl.o] Error 1
我是否可以为此获得解决方案或任何其他来源或链接的任何建议,我可以按照这些来源或链接来连接 ssd1963 LCD 并使用 Raspberrypi3 启用触摸。 添加makefile,
CC=gcc
AR=ar
DISPLAY?=ERROR
CFLAGS=-I/opt/vc/include -I. -Iinclude -D$(DISPLAY) -O3
prefix?=/usr/local
.PHONY: default all clean
default: tftgl
all: default
tftgl: libtftgl.a
libtftgl.a: src/tftgl.o
$(AR) rcs libtftgl.a src/tftgl.o
src/tftgl.o: src/tftgl.c src/tftgl_ssd1963.h src/tftgl_ads7843.h
$(CC) -c src/tftgl.c -o src/tftgl.o $(CFLAGS)
install: tftgl
install -m 0755 libtftgl.a $(prefix)/lib
install -m 0644 include/tftgl.h $(prefix)/include
clean:
-rm -f src/*.o
-rm -f libtftgl.a
我在这里提供 tftgl.c 的链接, https://github.com/matusnovak/rpi-tftgl/blob/master/tftgl/src/tftgl.c
【问题讨论】:
-
请显示代码和/或说明错误。请不要使用图片链接。问题中缺少文本。图片上的文字太小,有些人看不懂。图像上的文本无法被搜索引擎索引以供未来的访问者使用。另见Why not upload images of code on SO when asking a question?
-
-D0:0不正确。多说,我们需要查看 Makefile 的相关部分以及可能的配置脚本。另见How to create a Minimal, Complete, and Verifiable example。 -
@jww 我已经在代码块中添加了makefile,但是我不知道从哪里获取配置脚本。你能不能用它说点什么,这样我也明白我接下来要做什么。请帮我学习
-
显示定义应该类似于
CFLAGS=... -DDISPLAY="$(DISPLAY)"(可能带有一些额外的箍来保留引号)。这只是一个猜测。我们需要看看它是如何在src/tftgl.c中使用的。 -
@jww 我尝试使用您的建议更改生成文件并收到以下错误,gcc -c src/tftgl.c -o src/tftgl.o -I/opt/vc/include -I . -Iinclude --DDISPLAY=":0" gcc: error: unrecognized command line option '--DDISPLAY=:0' Makefile:18: recipe for target 'src/tftgl.o' failed make: *** [src/tftgl .o] 错误 1
标签: linux raspberry-pi3