[Libav-user] Beginner c++ compiling error
mounir younes
mounir.younes at gmail.com
Mon Oct 3 10:36:23 CEST 2011
This is my code: (i got it from the internet, and modified it)
------------------------
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
#ifdef __cplusplus
extern "C"
{
#include "libavdevice/avdevice.h"
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/avutil.h"
}
#endif
#include <stdlib.h>
///TODO: Decode the packets into frames and find their frame type (I, B, P)
int main(int argc, char **argv)
{
/// indexs and loop
int video_index, audio_index, i, picture;
char *filename = "bunny.mp4";
AVFrame *frame = avcodec_alloc_frame();
/// avcodec_ and avdevice_ must also be called or else the program will
error
avcodec_register_all();
avdevice_register_all();
av_register_all();
AVFormatContext *ic;
AVPacket pkt1, *pkt = &pkt1; /// Gives pkt a dummy value so it's not NULL
AVCodecContext *enc = NULL; /// Holds a single stream (codec)
AVCodec *codec;
/// open the file
if(av_open_input_file(&ic, filename, NULL, 0, NULL) < 0)
return -1;
/// get the information on the streams
if(av_find_stream_info(ic) < 0)
return -1;
picture=0;
/// find the index for video and audio
for(i = 0; i < ic->nb_streams; i++) {
enc = ic->streams[i]->codec;
switch(enc->codec_type) {
case AVMEDIA_TYPE_AUDIO:
audio_index = i;
break;
case AVMEDIA_TYPE_VIDEO:
video_index = i;
break;
default:
break;
}
}
/// Shows information about the file
dump_format(ic, 0, filename, 0);
/// read ALLL frames and get their types
/// decoding --> encoding section
codec = avcodec_find_decoder(ic->streams[video_index]->codec->codec_id);
enc = avcodec_alloc_context();
if (!codec ||
avcodec_open(enc, codec) < 0)
return -1;
i = 0; /// counts the frames encountered
while (1) {
if(av_read_frame(ic, pkt) < 0)
break;
if(pkt->stream_index == video_index) {
avcodec_decode_video2(enc, frame, &picture, pkt);
if(picture) {
switch(frame->pict_type) {
case FF_I_TYPE:
printf("I frame\n");
break;
case FF_B_TYPE:
printf("B frame\n");
break;
case FF_P_TYPE:
printf("P frame\n");
break;
default:
printf("Unknown frame\n");
}
i++;
}
}
av_free_packet( pkt);
}
printf("Number of frames: %d\n", i);
printf("Video stream index: %d\nAudio stream index: %d\n", video_index,
audio_index);
return 0;
}
This is what I am getting as exceptions:
----------------------------------------------------------
/usr/local/lib/libavdevice.a(alsa-audio-dec.o): In function
`audio_read_packet':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-dec.c:108: undefined
reference to `snd_pcm_readi'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-dec.c:125: undefined
reference to `snd_pcm_delay'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-dec.c:115: undefined
reference to `snd_strerror'
/usr/local/lib/libavdevice.a(alsa-audio-dec.o): In function
`audio_read_header':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-dec.c:93: undefined
reference to `snd_pcm_close'
/usr/local/lib/libavdevice.a(alsa-audio-enc.o): In function
`audio_get_output_timestamp':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-enc.c:112: undefined
reference to `snd_pcm_delay'
/usr/local/lib/libavdevice.a(alsa-audio-enc.o): In function
`audio_write_packet':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-enc.c:88: undefined
reference to `snd_pcm_writei'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-enc.c:95: undefined
reference to `snd_strerror'
/usr/local/lib/libavdevice.a(alsa-audio-enc.o): In function
`audio_write_header':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-enc.c:69: undefined
reference to `snd_pcm_close'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_packet':
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:239: undefined reference
to `av_buffersink_get_buffer_ref'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:253: undefined reference
to `av_buffersink_get_buffer_ref'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:268: undefined reference
to `avfilter_unref_buffer'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_close':
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:73: undefined reference to
`avfilter_graph_free'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_header':
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:89: undefined reference to
`avfilter_register_all'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:91: undefined reference to
`avfilter_get_by_name'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:101: undefined reference
to `avfilter_graph_alloc'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:104: undefined reference
to `avfilter_graph_parse'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:176: undefined reference
to `av_buffersink_params_alloc'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:183: undefined reference
to `avfilter_graph_create_filter'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:192: undefined reference
to `avfilter_link'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:197: undefined reference
to `avfilter_graph_config'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:218: undefined reference
to `avfilter_inout_free'
/home/mounir/Downloads/ffmpeg/libavdevice/lavfi.c:219: undefined reference
to `avfilter_inout_free'
/usr/local/lib/libavdevice.a(alsa-audio-common.o): In function
`ff_alsa_xrun_recover':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:334: undefined
reference to `snd_pcm_prepare'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:336: undefined
reference to `snd_strerror'
/usr/local/lib/libavdevice.a(alsa-audio-common.o): In function
`ff_alsa_open':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:213: undefined
reference to `snd_pcm_open'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:215: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:220: undefined
reference to `snd_pcm_hw_params_malloc'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:222: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:227: undefined
reference to `snd_pcm_hw_params_any'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:229: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:234: undefined
reference to `snd_pcm_hw_params_set_access'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:236: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:241: undefined
reference to `snd_pcm_hw_params_set_format'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:243: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:248: undefined
reference to `snd_pcm_hw_params_set_rate_near'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:250: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:255: undefined
reference to `snd_pcm_hw_params_set_channels'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:257: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:262: undefined
reference to `snd_pcm_hw_params_get_buffer_size_max'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:265: undefined
reference to `snd_pcm_hw_params_set_buffer_size_near'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:267: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:272: undefined
reference to `snd_pcm_hw_params_get_period_size_min'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:275: undefined
reference to `snd_pcm_hw_params_set_period_size_near'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:277: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:283: undefined
reference to `snd_pcm_hw_params'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:285: undefined
reference to `snd_strerror'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:290: undefined
reference to `snd_pcm_hw_params_free'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:311: undefined
reference to `snd_pcm_hw_params_free'
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:313: undefined
reference to `snd_pcm_close'
/usr/local/lib/libavdevice.a(alsa-audio-common.o): In function
`ff_alsa_close':
/home/mounir/Downloads/ffmpeg/libavdevice/alsa-audio-common.c:323: undefined
reference to `snd_pcm_close'
/usr/local/lib/libavcodec.a(cscd.o): In function `decode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/cscd.c:171: undefined reference to
`uncompress'
/usr/local/lib/libavcodec.a(dxa.o): In function `decode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/dxa.c:236: undefined reference to
`uncompress'
/usr/local/lib/libavcodec.a(flashsv.o): In function `flashsv_decode_block':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:165: undefined reference
to `inflateReset'
/usr/local/lib/libavcodec.a(flashsv.o): In function `flashsv2_prime':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:138: undefined reference
to `inflate'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:140: undefined reference
to `deflateInit_'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:145: undefined reference
to `deflate'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:146: undefined reference
to `deflateEnd'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:148: undefined reference
to `inflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:154: undefined reference
to `inflate'
/usr/local/lib/libavcodec.a(flashsv.o): In function `flashsv_decode_block':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:177: undefined reference
to `inflate'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:180: undefined reference
to `inflateSync'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:181: undefined reference
to `inflate'
/usr/local/lib/libavcodec.a(flashsv.o): In function
`calc_deflate_block_size':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:222: undefined reference
to `deflateInit_'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:224: undefined reference
to `deflateBound'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:225: undefined reference
to `deflateEnd'
/usr/local/lib/libavcodec.a(flashsv.o): In function `flashsv_decode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:443: undefined reference
to `inflateEnd'
/usr/local/lib/libavcodec.a(flashsv.o): In function `flashsv_decode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv.c:112: undefined reference
to `inflateInit_'
/usr/local/lib/libavcodec.a(flashsv2enc.o): In function `encode_zlib':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv2enc.c:337: undefined
reference to `compress2'
/usr/local/lib/libavcodec.a(flashsv2enc.o): In function `encode_zlibprime':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv2enc.c:349: undefined
reference to `deflateInit_'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv2enc.c:358: undefined
reference to `deflate'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv2enc.c:367: undefined
reference to `deflate'
/home/mounir/Downloads/ffmpeg/libavcodec/flashsv2enc.c:368: undefined
reference to `deflateEnd'
/usr/local/lib/libavcodec.a(flashsvenc.o): In function `encode_bitstream':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsvenc.c:169: undefined
reference to `compress2'
/usr/local/lib/libavcodec.a(flashsvenc.o): In function `flashsv_encode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/flashsvenc.c:269: undefined
reference to `deflateEnd'
/usr/local/lib/libavcodec.a(lcldec.o): In function `zlib_decomp':
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:131: undefined reference
to `inflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:140: undefined reference
to `inflate'
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:131: undefined reference
to `inflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:140: undefined reference
to `inflate'
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:131: undefined reference
to `inflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:140: undefined reference
to `inflate'
/usr/local/lib/libavcodec.a(lcldec.o): In function `decode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:606: undefined reference
to `inflateEnd'
/usr/local/lib/libavcodec.a(lcldec.o): In function `decode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/lcldec.c:580: undefined reference
to `inflateInit_'
/usr/local/lib/libavcodec.a(lclenc.o): In function `encode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/lclenc.c:87: undefined reference to
`deflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/lclenc.c:98: undefined reference to
`deflate'
/home/mounir/Downloads/ffmpeg/libavcodec/lclenc.c:104: undefined reference
to `deflate'
/usr/local/lib/libavcodec.a(lclenc.o): In function `encode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/lclenc.c:168: undefined reference
to `deflateEnd'
/usr/local/lib/libavcodec.a(lclenc.o): In function `encode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/lclenc.c:149: undefined reference
to `deflateInit_'
/usr/local/lib/libavcodec.a(pngdec.o): In function `decode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/pngdec.c:431: undefined reference
to `inflateInit_'
/home/mounir/Downloads/ffmpeg/libavcodec/pngdec.c:658: undefined reference
to `inflateEnd'
/usr/local/lib/libavcodec.a(pngdec.o): In function `png_decode_idat':
/home/mounir/Downloads/ffmpeg/libavcodec/pngdec.c:383: undefined reference
to `inflate'
/usr/local/lib/libavcodec.a(pngenc.o): In function `encode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:287: undefined reference
to `deflateInit2_'
/usr/local/lib/libavcodec.a(pngenc.o): In function `png_write_chunk':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:199: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:201: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:204: undefined reference
to `crc32'
/usr/local/lib/libavcodec.a(pngenc.o): In function `png_write_row':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:219: undefined reference
to `deflate'
/usr/local/lib/libavcodec.a(pngenc.o): In function `png_write_chunk':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:199: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:201: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:204: undefined reference
to `crc32'
/usr/local/lib/libavcodec.a(pngenc.o): In function `encode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:418: undefined reference
to `deflateEnd'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:396: undefined reference
to `deflate'
/usr/local/lib/libavcodec.a(pngenc.o): In function `png_write_chunk':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:199: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:201: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:204: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:199: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:201: undefined reference
to `crc32'
/usr/local/lib/libavcodec.a(pngenc.o): In function `png_write_row':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:219: undefined reference
to `deflate'
/usr/local/lib/libavcodec.a(pngenc.o): In function `png_write_chunk':
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:199: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:201: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:204: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:199: undefined reference
to `crc32'
/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:201: undefined reference
to `crc32'
/usr/local/lib/libavcodec.a(pngenc.o):/home/mounir/Downloads/ffmpeg/libavcodec/pngenc.c:204:
more undefined references to `crc32' follow
/usr/local/lib/libavcodec.a(svq3.o): In function `svq3_decode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/svq3.c:906: undefined reference to
`uncompress'
/usr/local/lib/libavcodec.a(tiff.o): In function `tiff_uncompress':
/home/mounir/Downloads/ffmpeg/libavcodec/tiff.c:98: undefined reference to
`inflate'
/home/mounir/Downloads/ffmpeg/libavcodec/tiff.c:99: undefined reference to
`inflateEnd'
/home/mounir/Downloads/ffmpeg/libavcodec/tiff.c:93: undefined reference to
`inflateInit_'
/usr/local/lib/libavcodec.a(tscc.o): In function `decode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/tscc.c:91: undefined reference to
`inflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/tscc.c:100: undefined reference to
`inflate'
/usr/local/lib/libavcodec.a(tscc.o): In function `decode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/tscc.c:197: undefined reference to
`inflateEnd'
/usr/local/lib/libavcodec.a(tscc.o): In function `decode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/tscc.c:173: undefined reference to
`inflateInit_'
/usr/local/lib/libavcodec.a(zmbv.o): In function `decode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/zmbv.c:498: undefined reference to
`inflate'
/home/mounir/Downloads/ffmpeg/libavcodec/zmbv.c:472: undefined reference to
`inflateReset'
/usr/local/lib/libavcodec.a(zmbv.o): In function `decode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/zmbv.c:647: undefined reference to
`inflateEnd'
/usr/local/lib/libavcodec.a(zmbv.o): In function `decode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/zmbv.c:623: undefined reference to
`inflateInit_'
/usr/local/lib/libavcodec.a(zmbvenc.o): In function `encode_frame':
/home/mounir/Downloads/ffmpeg/libavcodec/zmbvenc.c:144: undefined reference
to `deflateReset'
/home/mounir/Downloads/ffmpeg/libavcodec/zmbvenc.c:233: undefined reference
to `deflate'
/usr/local/lib/libavcodec.a(zmbvenc.o): In function `encode_end':
/home/mounir/Downloads/ffmpeg/libavcodec/zmbvenc.c:320: undefined reference
to `deflateEnd'
/usr/local/lib/libavcodec.a(zmbvenc.o): In function `encode_init':
/home/mounir/Downloads/ffmpeg/libavcodec/zmbvenc.c:297: undefined reference
to `deflateInit_'
/usr/local/lib/libavdevice.a(jack_audio.o): In function `process_callback':
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:72: undefined
reference to `jack_frames_since_cycle_start'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:93: undefined
reference to `jack_port_get_total_latency'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:94: undefined
reference to `jack_port_get_buffer'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:104: undefined
reference to `sem_post'
/usr/local/lib/libavdevice.a(jack_audio.o): In function `audio_read_packet':
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:262: undefined
reference to `jack_activate'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:275: undefined
reference to `sem_timedwait'
/usr/local/lib/libavdevice.a(jack_audio.o): In function `start_jack':
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:149: undefined
reference to `jack_client_open'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:155: undefined
reference to `sem_init'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:157: undefined
reference to `jack_get_sample_rate'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:159: undefined
reference to `jack_get_buffer_size'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:165: undefined
reference to `jack_port_register'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:177: undefined
reference to `jack_set_process_callback'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:179: undefined
reference to `jack_set_xrun_callback'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:171: undefined
reference to `jack_client_close'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:191: undefined
reference to `jack_client_close'
/usr/local/lib/libavdevice.a(jack_audio.o): In function `stop_jack':
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:213: undefined
reference to `jack_deactivate'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:214: undefined
reference to `jack_client_close'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:216: undefined
reference to `sem_destroy'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:214: undefined
reference to `jack_client_close'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:216: undefined
reference to `sem_destroy'
/home/mounir/Downloads/ffmpeg/libavdevice/jack_audio.c:213: undefined
reference to `jack_deactivate'
/usr/local/lib/libavdevice.a(sdl.o): In function `sdl_write_trailer':
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:64: undefined reference to
`SDL_FreeYUVOverlay'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:68: undefined reference to
`SDL_Quit'
/usr/local/lib/libavdevice.a(sdl.o): In function `sdl_write_packet':
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:188: undefined reference to
`SDL_MapRGB'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:188: undefined reference to
`SDL_FillRect'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:190: undefined reference to
`SDL_LockYUVOverlay'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:195: undefined reference to
`SDL_DisplayYUVOverlay'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:196: undefined reference to
`SDL_UnlockYUVOverlay'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:198: undefined reference to
`SDL_UpdateRect'
/usr/local/lib/libavdevice.a(sdl.o): In function `sdl_write_header':
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:86: undefined reference to
`SDL_WasInit'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:94: undefined reference to
`SDL_Init'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:149: undefined reference to
`SDL_WM_SetCaption'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:150: undefined reference to
`SDL_SetVideoMode'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:158: undefined reference to
`SDL_CreateYUVOverlay'
/usr/local/lib/libavdevice.a(sdl.o): In function `sdl_write_trailer':
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:64: undefined reference to
`SDL_FreeYUVOverlay'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:68: undefined reference to
`SDL_Quit'
/usr/local/lib/libavdevice.a(sdl.o): In function `sdl_write_header':
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:95: undefined reference to
`SDL_GetError'
/home/mounir/Downloads/ffmpeg/libavdevice/sdl.c:153: undefined reference to
`SDL_GetError'
/usr/local/lib/libavformat.a(matroskadec.o): In function
`matroska_decode_buffer':
/home/mounir/Downloads/ffmpeg/libavformat/matroskadec.c:993: undefined
reference to `inflateInit_'
/home/mounir/Downloads/ffmpeg/libavformat/matroskadec.c:1003: undefined
reference to `inflate'
/home/mounir/Downloads/ffmpeg/libavformat/matroskadec.c:1008: undefined
reference to `inflateEnd'
/home/mounir/Downloads/ffmpeg/libavformat/matroskadec.c:1008: undefined
reference to `inflateEnd'
/usr/local/lib/libavformat.a(mov.o): In function `mov_read_cmov':
/home/mounir/Downloads/ffmpeg/libavformat/mov.c:2180: undefined reference to
`uncompress'
/usr/local/lib/libavformat.a(udp.o): In function `udp_open':
/home/mounir/Downloads/ffmpeg/libavformat/udp.c:519: undefined reference to
`pthread_create'
/usr/local/lib/libavcodec.a(pthread.o): In function `frame_thread_free':
/home/mounir/Downloads/ffmpeg/libavcodec/pthread.c:645: undefined reference
to `pthread_join'
/usr/local/lib/libavcodec.a(pthread.o): In function `thread_free':
/home/mounir/Downloads/ffmpeg/libavcodec/pthread.c:179: undefined reference
to `pthread_join'
/usr/local/lib/libavcodec.a(pthread.o): In function `frame_thread_init':
/home/mounir/Downloads/ffmpeg/libavcodec/pthread.c:732: undefined reference
to `pthread_create'
/usr/local/lib/libavcodec.a(pthread.o): In function `thread_init':
/home/mounir/Downloads/ffmpeg/libavcodec/pthread.c:256: undefined reference
to `pthread_create'
/usr/local/lib/libavcodec.a(tiffenc.o): In function `encode_strip':
/home/mounir/Downloads/ffmpeg/libavcodec/tiffenc.c:163: undefined reference
to `compress'
/usr/local/lib/libavcodec.a(vaapi.o): In function `commit_slices':
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:97: undefined reference to
`vaCreateBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:106: undefined reference to
`vaCreateBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function `alloc_buffer':
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:125: undefined reference to
`vaCreateBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:127: undefined reference to
`vaMapBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:125: undefined reference to
`vaCreateBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:127: undefined reference to
`vaMapBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:125: undefined reference to
`vaCreateBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:127: undefined reference to
`vaMapBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function `destroy_buffers':
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:37: undefined reference to
`vaDestroyBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:37: undefined reference to
`vaDestroyBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:37: undefined reference to
`vaDestroyBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:37: undefined reference to
`vaDestroyBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function `render_picture':
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:48: undefined reference to
`vaUnmapBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:61: undefined reference to
`vaBeginPicture'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:52: undefined reference to
`vaUnmapBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:57: undefined reference to
`vaUnmapBuffer'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:65: undefined reference to
`vaRenderPicture'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:69: undefined reference to
`vaRenderPicture'
/home/mounir/Downloads/ffmpeg/libavcodec/vaapi.c:74: undefined reference to
`vaEndPicture'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/decoderapp] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
Is it a problem in the directory from where i am getting the .a libs?? Where
should I get them from if it is the case ?
On Sat, Oct 1, 2011 at 11:40 PM, jan hölscher <jan.hoelscher at codergrid.de>wrote:
> Okt, could you give us an example of which function name could not be
> resolved?
> Am 01.10.2011 22:28 schrieb "mounir younes" <mounir.younes at gmail.com>:
>
> > i am using netbeans and in the libraries tab there is a linker command
> where
> > i am adding the libs i stated in the thread before. Netbeans is catching
> the
> > libs (giving them a lib icon otherwise it would've given them a "blank"
> > icon) but I am always getting the "undefined reference to <functionName>"
> > (when using ffmpeg functions). I would really appreciate it if someone
> can
> > write a really really really small tutorial that shows how to build ur
> first
> > ffmpeg program (using the latest ffmpeg) and run it. That would help a
> lot
> > of people other than me for a lot of people are having this problem and
> some
> > others after updating ffmpeg.
> >
> > On Thu, Sep 29, 2011 at 1:39 AM, jan hölscher <
> jan.hoelscher at codergrid.de>wrote:
> >
> >> before we can discuss further, please provide the complete command line
> to
> >> the linker and error from it.
> >>
> >>
> >>
> >> 2011/9/29 mounir younes <mounir.younes at gmail.com>
> >>
> >>> Yes I did that ! But still having the problem after building.
> >>>
> >>>
> >>> On Wed, Sep 28, 2011 at 7:53 PM, jan hölscher <
> jan.hoelscher at codergrid.de
> >>> > wrote:
> >>>
> >>>> did you surround your libav header includes with :
> >>>>
> >>>> #ifdef __cplusplus
> >>>> extern "C" {
> >>>> #endif
> >>>> #include <libavformat/avformat.h>
> >>>> #include <libavcodec/avcodec.h>
> >>>> #include <libavcodec/opt.h>
> >>>> #include <libavutil/avutil.h>
> >>>> #include <libswscale/swscale.h>
> >>>> #include <libavutil/fifo.h>
> >>>> #include <libavutil/rational.h>
> >>>> #ifdef __cplusplus
> >>>> }
> >>>> #endif
> >>>>
> >>>>
> >>>> 2011/9/28 mounir younes <mounir.younes at gmail.com>
> >>>>
> >>>>> I gave the names without the linker prefix. I keep getting the
> >>>>> "undefined reference to" error and cannot solve it.
> >>>>>
> >>>>> On Sat, Sep 24, 2011 at 10:43 PM, Alex Cohn <
> alexcohn at netvision.net.il>wrote:
> >>>>>
> >>>>>> In your list of libs, "-l" is obviously doubled. Try to give the
> names
> >>>>>> to the linker without the prefix.
> >>>>>> On Sep 24, 2011 7:58 AM, "mounir younes" <mounir.younes at gmail.com>
> >>>>>> wrote:
> >>>>>> > Hello, I am new to ffmpeg and I am getting compiling errors while
> >>>>>> compiling
> >>>>>> > c++ code with ffmpeg libraries. It seems that a lot of people are
> >>>>>> getting
> >>>>>> > this with the new ffmpeg but I couldn't find a solution that I
> could
> >>>>>> > understand.
> >>>>>> >
> >>>>>> > I found a link that says that this
> >>>>>> >
> >>>>>> > CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure
> >>>>>> > (http://code.google.com/p/ffmpegsource/issues/detail?id=11)
> >>>>>> >
> >>>>>> >
> >>>>>> > solves it but unfortunately I tried it but nothing happened and I
> >>>>>> don't know
> >>>>>> > what to do ! I am adding the file headers which are being
> >>>>>> automatically
> >>>>>> > detected by netbeans so the libraries are already found. I tried
> >>>>>> adding
> >>>>>> > these -lavdevice -lavformat -lavcodec -lavutil -lswscale -lbz2 to
> the
> >>>>>> > linker as well
> >>>>>> >
> >>>>>> > (
> >>>>>> >
> >>>>>>
> http://libav-users.943685.n4.nabble.com/QT-and-FFmpeg-undefined-reference-to-av-free-and-more-td946811.html
> >>>>>> > )
> >>>>>> >
> >>>>>> > when adding them netbeans knew them and gave them proper library
> >>>>>> icons (thus
> >>>>>> > it recognized that these libraries are present otherwise it
> would've
> >>>>>> > replaced them with a white icon with question mark). But, when
> >>>>>> compiling I
> >>>>>> > get this
> >>>>>> >
> >>>>>> > /usr/bin/ld: cannot find -l-lavdevice
> >>>>>> > /usr/bin/ld: cannot find -l-lavformat
> >>>>>> > /usr/bin/ld: cannot find -l-lavcodec
> >>>>>> > /usr/bin/ld: cannot find -l-lavutil
> >>>>>> > /usr/bin/ld: cannot find -l-lswscale
> >>>>>> > /usr/bin/ld: cannot find -l-lbz2
> >>>>>> >
> >>>>>> > And this is really killing me. I have been trying to solve this
> for
> >>>>>> days.
> >>>>>> >
> >>>>>> > Thank you in advance.
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> Libav-user mailing list
> >>>>>> Libav-user at ffmpeg.org
> >>>>>> http://ffmpeg.org/mailman/listinfo/libav-user
> >>>>>>
> >>>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> Libav-user mailing list
> >>>>> Libav-user at ffmpeg.org
> >>>>> http://ffmpeg.org/mailman/listinfo/libav-user
> >>>>>
> >>>>>
> >>>>
> >>>> _______________________________________________
> >>>> Libav-user mailing list
> >>>> Libav-user at ffmpeg.org
> >>>> http://ffmpeg.org/mailman/listinfo/libav-user
> >>>>
> >>>>
> >>>
> >>> _______________________________________________
> >>> Libav-user mailing list
> >>> Libav-user at ffmpeg.org
> >>> http://ffmpeg.org/mailman/listinfo/libav-user
> >>>
> >>>
> >>
> >> _______________________________________________
> >> Libav-user mailing list
> >> Libav-user at ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/libav-user
> >>
> >>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20111003/881ea134/attachment.html>
More information about the Libav-user
mailing list