linux - :0:1: 错误:宏名必须是标识符........这个错误的解决方案?
问题描述
我正在尝试按照本指南将ssd1963 LCD 与 Raspberry Pi3 型号 B+ 连接Github
。
在尝试安装makefile
提供的rpi-tftgl
目录rpi-tftgl/tftgl
时,我在运行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
解决方案
的(作者)Makefile
没有考虑到环境变量DISPLAY
可以定义为宏定义以外的其他东西。由于没有记录您是否需要以及如何定义它,因此您能做的最好的事情就是make
使用 unset 变量:
(unset DISPLAY; make)
如果您更喜欢更改 makefile,只需删除?
from DISPLAY?=ERROR
,留下DISPLAY=ERROR
.
推荐阅读
- android - 使用 frida 绕过 Flutter 应用的 Sslpinning 中的空地址
- github - 身份验证已删除。请改用个人访问令牌
- c++ - 克隆带有散列的随机指针的链表
- python - 安装 cuDNN 后出现错误消息“无分配器统计信息”
- go - 在六边形架构中,周期性后台任务适合哪里?
- python - 如何使用python加载多个json文件并一一读取文件
- button - 我可以在将当前页面重定向到另一个表单时打开一个新标签吗?
- node.js - 使用 Node.js 和 React 将私有 S3 存储桶中的视频提供给经过身份验证的用户
- c# - 在我的 C# 代码中遇到 NullReferenceException,我不知道为什么!!!!Unity3D 按钮问题 :(
- phpmyadmin - phpMyAdmin 5.1.1 文本和文本区域太大