[Libav-user] undefined reference from static Libraries

Vittalprasad vittalprasad.br at gmail.com
Tue Mar 6 15:52:11 EET 2018


Hi All,

i have written make file to build own sample application using FFMPEG
static libraries, but i'm getting more than 200+ undefined reference errors
while compiling.
*Error exampls:*
./lib/libavcodec.a(mscc.o): In function `decode_init':
/home/bvittalprasad/ffmpeg_sources/ffmpeg/libavcodec/mscc.c:205: undefined
reference to `inflateInit_'
./lib/libavcodec.a(nellymoserdec.o): In function `nelly_decode_block':

>From error statements looks like static library once again looking for .c
files.

Makefile:
ROOT = .

SRC_DIR = $(ROOT)/src
INCLUDES = -I$(ROOT)/include


OBJECTS_BASE = $(ROOT)/obj
BIN_BASE = $(ROOT)/bin

LIBS = $(ROOT)/lib/libavdevice.a
LIBS+= $(ROOT)/lib/libavformat.a
LIBS+= $(ROOT)/lib/libavfilter.a
LIBS+= $(ROOT)/lib/libavcodec.a
LIBS+= $(ROOT)/lib/libswscale.a
LIBS+= $(ROOT)/lib/libavutil.a
#LIBS+= $(ROOT)/lib/libx264.a
#LIBS+= $(ROOT)/lib/libfdk-aac.a

OBJECTS+=  $(OBJECTS_BASE)/transcoding.o

#all
all: obj \
        lib \
        bin
obj:$(OBJECTS)
lib:
bin: $(BIN_BASE)/transcoding

$(OBJECTS_BASE)/%.o: $(SRC_DIR)/%.c
        $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

$(BIN_BASE)/transcoding: $(OBJECTS)
        $(LN) $(OBJECTS)  $(LIBS)  -lrt -o $@


please let me know how to link this static libraries.


-- 
Thanks & Regards
Vittal Prasad B R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180306/b273df18/attachment.html>


More information about the Libav-user mailing list