gpt4 book ai didi

c++ - 生成文件 : error running 'make all'

转载 作者:太空宇宙 更新时间:2023-11-03 10:45:41 28 4
gpt4 key购买 nike

当我运行 make all 规则中指定的相同 gcc 命令时,我没有收到任何错误。但是当我运行 make all 时,我得到了一堆错误。为什么会这样?

生成文件:

all: program.c
gcc -I$HOME/ffmpeg/include program.c -L$HOME/ffmpeg/lib -lswscale -lavdevice -lavfilter -lswscale -lswresample -lavformat -lavcodec -lavutil -lz -lm -lpthread -o program

运行 gcc 命令:

 (No error)

运行 make all:

gcc -IOME/ffmpeg/include program.c -LOME/ffmpeg/lib -lswscale -lavdevice -lavfilter -lswscale -lswresample -lavformat -lavcodec -lavutil -lz -lm -lpthread -o program
program.c:15:32: error: libavcodec/avcodec.h: No such file or directory
program.c:16:32: error: libswscale/swscale.h: No such file or directory
program.c:17:34: error: libavformat/avformat.h: No such file or directory
program.c:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
program.c:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
program.c:95: error: expected ')' before '*' token
program.c:128: error: expected ')' before '*' token
program.c:201: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
program.c: In function 'main':
program.c:253: error: 'AVFrame' undeclared (first use in this function)
program.c:253: error: (Each undeclared identifier is reported only once
program.c:253: error: for each function it appears in.)
program.c:253: error: 'loaded_image' undeclared (first use in this function)
program.c:255: error: 'img_copy' undeclared (first use in this function)
program.c:255: error: 'AV_PIX_FMT_RGB24' undeclared (first use in this function)
program.c:256: error: 'current_frame' undeclared (first use in this function)
make: *** [all] Error 1

最佳答案

$HOME 在您的 make 环境中扩展为 OME。如果你想让 shell 展开它,你需要转义它:

  gcc -I$$HOME/ffmpeg/include ...

你现在发生的事情是 make$H 扩展为空,然后按原样使用该行的其余部分。

关于c++ - 生成文件 : error running 'make all' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22518314/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com