[Libav-user] linker error after compiling encoding_decoding.c
satya gowtham kudupudi
satyagowtham.k at gmail.com
Sat Sep 28 09:51:34 CEST 2013
On ubuntu i've installed ffmpeg as per
http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide I'm trying to
compile
http://www.ffmpeg.org/doxygen/2.0/doc_2examples_2decoding_encoding_8c-example.html
;
changed int main<http://www.ffmpeg.org/doxygen/2.0/main_8c.html#a3c04138a5bfe5d72780bb7e82a18e627>
(int argc, char **argv) to int libavcodec_example(int argc, char **argv);
included it in my application; called libavcodec_example(int argc, char
**argv)
g++ -D__STDC_CONSTANT_MACROS -o
dist/Debug/GNU-Linux-x86/remotedevicecontroller
build/Debug/GNU-Linux-x86/libavcodec-example.o
build/Debug/GNU-Linux-x86/main.o build/Debug/GNU-Linux-x86/test-echo.o
/usr/local/ffmpeg_build/lib/libavdevice.a
/usr/local/ffmpeg_build/lib/libavfilter.a
/usr/local/ffmpeg_build/lib/libavcodec.a
/usr/local/ffmpeg_build/lib/libavutil.a
/usr/local/ffmpeg_build/lib/libswscale.a
/usr/local/ffmpeg_build/lib/libavformat.a -lxml2 -lpthread -lssl -lcrypto
-lwebsockets
It gave the following error:
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`select_channel_layout':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:77:
undefined reference to `av_get_channel_layout_nb_channels(unsigned long
long)'
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`audio_encode_example':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:102:
undefined reference to `avcodec_find_encoder(AVCodecID)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:107:
undefined reference to `avcodec_alloc_context3(AVCodec const*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:118:
undefined reference to `av_get_sample_fmt_name(AVSampleFormat)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:124:
undefined reference to `av_get_channel_layout_nb_channels(unsigned long
long)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:126:
undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*,
AVDictionary**)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:136:
undefined reference to `avcodec_alloc_frame()'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:147:
undefined reference to `av_samples_get_buffer_size(int*, int, int,
AVSampleFormat, int)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:148:
undefined reference to `av_malloc(unsigned int)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:156:
undefined reference to `avcodec_fill_audio_frame(AVFrame*, int,
AVSampleFormat, unsigned char const*, int, int)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:165:
undefined reference to `av_init_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:175:
undefined reference to `avcodec_encode_audio2(AVCodecContext*, AVPacket*,
AVFrame const*, int*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:182:
undefined reference to `av_free_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:187:
undefined reference to `avcodec_encode_audio2(AVCodecContext*, AVPacket*,
AVFrame const*, int*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:194:
undefined reference to `av_free_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:198:
undefined reference to `av_freep(void*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:199:
undefined reference to `avcodec_free_frame(AVFrame**)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:200:
undefined reference to `avcodec_close(AVCodecContext*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:201:
undefined reference to `av_free(void*)'
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`audio_decode_example':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:215:
undefined reference to `av_init_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:218:
undefined reference to `avcodec_find_decoder(AVCodecID)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:223:
undefined reference to `avcodec_alloc_context3(AVCodec const*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:229:
undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*,
AVDictionary**)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:240:
undefined reference to `av_free(void*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:249:
undefined reference to `avcodec_alloc_frame()'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:254:
undefined reference to `avcodec_get_frame_defaults(AVFrame*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:255:
undefined reference to `avcodec_decode_audio4(AVCodecContext*, AVFrame*,
int*, AVPacket const*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:264:
undefined reference to `av_samples_get_buffer_size(int*, int, int,
AVSampleFormat, int)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:286:
undefined reference to `avcodec_close(AVCodecContext*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:287:
undefined reference to `av_free(void*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:288:
undefined reference to `avcodec_free_frame(AVFrame**)'
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`video_encode_example':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:304:
undefined reference to `avcodec_find_encoder(AVCodecID)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:309:
undefined reference to `avcodec_alloc_context3(AVCodec const*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:325:
undefined reference to `av_opt_set(void*, char const*, char const*, int)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:327:
undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*,
AVDictionary**)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:336:
undefined reference to `avcodec_alloc_frame()'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:347:
undefined reference to `av_image_alloc(unsigned char**, int*, int, int,
AVPixelFormat, int)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:354:
undefined reference to `av_init_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:374:
undefined reference to `avcodec_encode_video2(AVCodecContext*, AVPacket*,
AVFrame const*, int*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:382:
undefined reference to `av_free_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:388:
undefined reference to `avcodec_encode_video2(AVCodecContext*, AVPacket*,
AVFrame const*, int*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:396:
undefined reference to `av_free_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:402:
undefined reference to `avcodec_close(AVCodecContext*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:403:
undefined reference to `av_free(void*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:404:
undefined reference to `av_freep(void*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:405:
undefined reference to `avcodec_free_frame(AVFrame**)'
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`decode_write_frame':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:427:
undefined reference to `avcodec_decode_video2(AVCodecContext*, AVFrame*,
int*, AVPacket const*)'
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`video_decode_example':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:456:
undefined reference to `av_init_packet(AVPacket*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:461:
undefined reference to `avcodec_find_decoder(AVCodecID)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:466:
undefined reference to `avcodec_alloc_context3(AVCodec const*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:477:
undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*,
AVDictionary**)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:486:
undefined reference to `avcodec_alloc_frame()'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:520:
undefined reference to `avcodec_close(AVCodecContext*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:521:
undefined reference to `av_free(void*)'
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:522:
undefined reference to `avcodec_free_frame(AVFrame**)'
build/Debug/GNU-Linux-x86/libavcodec-example.o: In function
`libavcodec_example(int, char**)':
/home/gowtham/NetBeansProjects/remotedevicecontroller/libavcodec-example.cpp:529:
undefined reference to `avcodec_register_all()'
collect2: error: ld returned 1 exit status
how should I succeed?
--
*Gowtham*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130928/f58ecf43/attachment.html>
More information about the Libav-user
mailing list