Makefile 为什么C代码会接收到消息;架构x86_64的未定义符号:“;?

Makefile 为什么C代码会接收到消息;架构x86_64的未定义符号:“;?,makefile,decode,libav,Makefile,Decode,Libav,我想用一个自定义的makefile构建一个c程序。libs文件夹位于父文件夹中,并通过LD标志在makefie中链接(无全局安装)。当我构建程序(解码器)时,我既没有收到错误也没有收到警告,而是收到以下消息: -------------- Build: Debug in KIS01b (compiler: GNU GCC Compiler)--------------- Running command: make -f Makefile.mak Debug gcc -o KIS01b KIS0

我想用一个自定义的makefile构建一个c程序。libs文件夹位于父文件夹中,并通过LD标志在makefie中链接(无全局安装)。当我构建程序(解码器)时,我既没有收到错误也没有收到警告,而是收到以下消息:

-------------- Build: Debug in KIS01b (compiler: GNU GCC Compiler)---------------

Running command: make -f Makefile.mak Debug
gcc -o KIS01b KIS01b.o -L../libs/lib -lm
Undefined symbols for architecture x86_64:
"_av_frame_alloc", referenced from:
  _main in KIS01b.o
"_av_frame_free", referenced from:
  _main in KIS01b.o
"_av_free", referenced from:
  _main in KIS01b.o
"_av_freep", referenced from:
  _decode in KIS01b.o
"_av_get_channel_layout_nb_channels", referenced from:
  _decode in KIS01b.o
"_av_malloc", referenced from:
  _decode in KIS01b.o
"_av_packet_alloc", referenced from:
  _main in KIS01b.o
"_av_packet_free", referenced from:
  _main in KIS01b.o
"_av_parser_close", referenced from:
  _main in KIS01b.o
"_av_parser_init", referenced from:
  _main in KIS01b.o
"_av_parser_parse2", referenced from:
  _main in KIS01b.o
"_avcodec_alloc_context3", referenced from:
  _main in KIS01b.o
"_avcodec_find_decoder", referenced from:
  _main in KIS01b.o
"_avcodec_free_context", referenced from:
  _main in KIS01b.o
"_avcodec_open2", referenced from:
  _main in KIS01b.o
"_avcodec_receive_frame", referenced from:
  _decode in KIS01b.o
"_avcodec_register_all", referenced from:
  _main in KIS01b.o
"_avcodec_send_packet", referenced from:
  _decode in KIS01b.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [KIS01b] Error 1
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
这里是makefile

CC = gcc
CFLAGS = -c -Wall -I../libs/include
LDFLAGS = -L../libs/lib -lm

all: Release

Debug: CFLAGS += -g
Debug: KIS01b

Release: KIS01b

KIS01b: KIS01b.o
$(CC) -o KIS01b KIS01b.o $(LDFLAGS)

KIS01b.o: KIS01b.c
$(CC) $(CFLAGS) KIS01b.c -o KIS01b.o

clean:
rm -f KIS01b.o KIS01b
c代码就是这个链接中的代码:


你知道会出什么问题吗?

看起来你安装了library-devel.i686,但没有安装library-devel.x86\u 64,这是构建此程序所必需的。符号
\u av*
很可能来自
libav
库,但是我看到在你的Makefile中没有链接到该库。它的可能副本似乎你已经安装了library-devel.i686,但是没有安装library-devel.x86\u 64,这是构建此程序所必需的。符号
\u av*
很可能来自
libav
库,但是我发现你的Makefile中没有链接到这个库。可能是