Hi Thanks for your advice! But I am compiling under Ubuntu.
It is very clear that some flags are missing that I did not need to add in, in a previous version of ffmpeg. Any idea what is missing? What is the command you use to compile api-example.c? What are environment variables that need to be set. Can you please check and let me know? Thanks in advance! On Thu, Jul 1, 2010 at 9:38 AM, yi nianhua <[email protected]> wrote: > http://article.gmane.org/gmane.comp.video.ffmpeg.devel/73040 > <http://article.gmane.org/gmane.comp.video.ffmpeg.devel/73040>maybe this > will help you. > > On Thu, Jul 1, 2010 at 12:15 AM, S R <[email protected]> wrote: > > > Hi > > > > This is what I get when I use gcc. Another set of errors. > > > > I must be doing something wrong. Can anyone please correct? > > > > gcc -Wall -Wconversion -g -fPIC api-example.c -o api-example -lavformat > > -lavcodec -lavutil -lswscale -lz -lbz2 -lm > > api-example.c: In function ‘audio_encode_example’: > > api-example.c:82: warning: conversion to ‘size_t’ from ‘int’ may change > the > > sign of the result > > api-example.c:84: warning: conversion to ‘size_t’ from ‘int’ may change > the > > sign of the result > > api-example.c:94: warning: conversion to ‘float’ from ‘double’ may alter > > its > > value > > api-example.c:97: warning: conversion to ‘short int’ from ‘int’ may alter > > its value > > api-example.c:103: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c: In function ‘audio_decode_example’: > > api-example.c:160: warning: conversion to ‘int’ from ‘size_t’ may change > > the > > sign of the result > > api-example.c:171: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c:180: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c:183: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c:183: warning: conversion to ‘int’ from ‘size_t’ may change > > the > > sign of the result > > api-example.c: In function ‘video_encode_example’: > > api-example.c:246: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c:248: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c:264: warning: conversion to ‘uint8_t’ from ‘int’ may alter > > its > > value > > api-example.c:271: warning: conversion to ‘uint8_t’ from ‘int’ may alter > > its > > value > > api-example.c:272: warning: conversion to ‘uint8_t’ from ‘int’ may alter > > its > > value > > api-example.c:279: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c:288: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c: In function ‘pgm_save’: > > api-example.c:320: warning: conversion to ‘size_t’ from ‘int’ may change > > the > > sign of the result > > api-example.c: In function ‘video_decode_example’: > > api-example.c:375: warning: conversion to ‘int’ from ‘size_t’ may change > > the > > sign of the result > > /usr/local/lib/libavcodec.a(libfaac.o): In function `Faac_encode_frame': > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:128: undefined reference to > > `faacEncEncode' > > /usr/local/lib/libavcodec.a(libfaac.o): In function `Faac_encode_close': > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:144: undefined reference to > > `faacEncClose' > > /usr/local/lib/libavcodec.a(libfaac.o): In function `Faac_encode_init': > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:46: undefined reference to > > `faacEncOpen' > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:51: undefined reference to > > `faacEncGetCurrentConfiguration' > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:75: undefined reference to > > `faacEncClose' > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:114: undefined reference to > > `faacEncSetConfiguration' > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:54: undefined reference to > > `faacEncClose' > > /home/sujoy/ffmpeg/libavcodec/libfaac.c:102: undefined reference to > > `faacEncGetDecoderSpecificInfo' > > /usr/local/lib/libavcodec.a(libmp3lame.o): In function > > `MP3lame_encode_frame': > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:160: undefined reference to > > `lame_encode_buffer' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:152: undefined reference to > > `lame_encode_buffer_interleaved' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:170: undefined reference to > > `lame_encode_flush' > > /usr/local/lib/libavcodec.a(libmp3lame.o): In function > > `MP3lame_encode_close': > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:212: undefined reference to > > `lame_close' > > /usr/local/lib/libavcodec.a(libmp3lame.o): In function > > `MP3lame_encode_init': > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:48: undefined reference to > > `lame_init' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:50: undefined reference to > > `lame_set_in_samplerate' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:51: undefined reference to > > `lame_set_out_samplerate' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:52: undefined reference to > > `lame_set_num_channels' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:56: undefined reference to > > `lame_set_quality' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:59: undefined reference to > > `lame_set_mode' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:60: undefined reference to > > `lame_set_brate' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:66: undefined reference to > > `lame_set_bWriteVbrTag' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:67: undefined reference to > > `lame_set_disable_reservoir' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:68: undefined reference to > > `lame_init_params' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:71: undefined reference to > > `lame_get_framesize' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:54: undefined reference to > > `lame_set_quality' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:79: undefined reference to > > `lame_close' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:62: undefined reference to > > `lame_set_brate' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:63: undefined reference to > > `lame_set_VBR' > > /home/sujoy/ffmpeg/libavcodec/libmp3lame.c:64: undefined reference to > > `lame_set_VBR_q' > > /usr/local/lib/libavcodec.a(libtheoraenc.o): In function `submit_stats': > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:134: undefined reference to > > `th_encode_ctl' > > /usr/local/lib/libavcodec.a(libtheoraenc.o): In function `get_stats': > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:93: undefined reference to > > `th_encode_ctl' > > /usr/local/lib/libavcodec.a(libtheoraenc.o): In function `encode_frame': > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:294: undefined reference to > > `th_encode_ycbcr_in' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:317: undefined reference to > > `th_encode_packetout' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:274: undefined reference to > > `th_encode_packetout' > > /usr/local/lib/libavcodec.a(libtheoraenc.o): In function `encode_close': > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:349: undefined reference to > > `th_encode_free' > > /usr/local/lib/libavcodec.a(libtheoraenc.o): In function `encode_init': > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:162: undefined reference to > > `th_info_init' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:214: undefined reference to > > `th_encode_alloc' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:222: undefined reference to > > `th_info_clear' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:224: undefined reference to > > `th_encode_ctl' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:249: undefined reference to > > `th_comment_init' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:251: undefined reference to > > `th_encode_flushheader' > > /home/sujoy/ffmpeg/libavcodec/libtheoraenc.c:255: undefined reference to > > `th_comment_clear' > > /usr/local/lib/libavcodec.a(libvorbis.o): In function > > `oggvorbis_encode_frame': > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:152: undefined reference to > > `vorbis_analysis_buffer' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:159: undefined reference to > > `vorbis_analysis_wrote' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:166: undefined reference to > > `vorbis_analysis_blockout' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:167: undefined reference to > > `vorbis_analysis' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:168: undefined reference to > > `vorbis_bitrate_addblock' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:170: undefined reference to > > `vorbis_bitrate_flushpacket' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:162: undefined reference to > > `vorbis_analysis_wrote' > > /usr/local/lib/libavcodec.a(libvorbis.o): In function > > `oggvorbis_encode_close': > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:206: undefined reference to > > `vorbis_analysis_wrote' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:208: undefined reference to > > `vorbis_block_clear' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:209: undefined reference to > > `vorbis_dsp_clear' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:210: undefined reference to > > `vorbis_info_clear' > > /usr/local/lib/libavcodec.a(libvorbis.o): In function > > `oggvorbis_encode_init': > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:94: undefined reference to > > `vorbis_info_init' > > /usr/local/lib/libavcodec.a(libvorbis.o): In function > > `oggvorbis_init_encoder': > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:68: undefined reference to > > `vorbis_encode_setup_managed' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:85: undefined reference to > > `vorbis_encode_setup_init' > > /usr/local/lib/libavcodec.a(libvorbis.o): In function > > `oggvorbis_encode_init': > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:99: undefined reference to > > `vorbis_analysis_init' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:100: undefined reference to > > `vorbis_block_init' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:102: undefined reference to > > `vorbis_comment_init' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:103: undefined reference to > > `vorbis_comment_add_tag' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:105: undefined reference to > > `vorbis_analysis_headerout' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:127: undefined reference to > > `vorbis_comment_clear' > > /usr/local/lib/libavcodec.a(libvorbis.o): In function > > `oggvorbis_init_encoder': > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:59: undefined reference to > > `vorbis_encode_setup_vbr' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:81: undefined reference to > > `vorbis_encode_ctl' > > /home/sujoy/ffmpeg/libavcodec/libvorbis.c:74: undefined reference to > > `vorbis_encode_ctl' > > /usr/local/lib/libavcodec.a(libx264.o): In function `X264_frame': > > /home/sujoy/ffmpeg/libavcodec/libx264.c:92: undefined reference to > > `x264_picture_init' > > /home/sujoy/ffmpeg/libavcodec/libx264.c:107: undefined reference to > > `x264_encoder_encode' > > /home/sujoy/ffmpeg/libavcodec/libx264.c:113: undefined reference to > > `x264_encoder_delayed_frames' > > /home/sujoy/ffmpeg/libavcodec/libx264.c:107: undefined reference to > > `x264_encoder_encode' > > /usr/local/lib/libavcodec.a(libx264.o): In function `X264_close': > > /home/sujoy/ffmpeg/libavcodec/libx264.c:146: undefined reference to > > `x264_encoder_close' > > /usr/local/lib/libavcodec.a(libx264.o): In function `X264_init': > > /home/sujoy/ffmpeg/libavcodec/libx264.c:156: undefined reference to > > `x264_param_default' > > /home/sujoy/ffmpeg/libavcodec/libx264.c:300: undefined reference to > > `x264_encoder_open_100' > > /home/sujoy/ffmpeg/libavcodec/libx264.c:310: undefined reference to > > `x264_encoder_headers' > > /usr/local/lib/libavcodec.a(libxvidff.o): In function > `xvid_encode_frame': > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:431: undefined reference to > > `xvid_encore' > > /usr/local/lib/libavcodec.a(libxvidff.o): In function > `xvid_encode_close': > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:481: undefined reference to > > `xvid_encore' > > /usr/local/lib/libavcodec.a(libxvidff.o): In function `xvid_encode_init': > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:184: undefined reference to > > `xvid_global' > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:271: undefined reference to > > `xvid_plugin_lumimasking' > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:349: undefined reference to > > `xvid_encore' > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:264: undefined reference to > > `xvid_plugin_single' > > /home/sujoy/ffmpeg/libavcodec/libxvidff.c:255: undefined reference to > > `xvid_plugin_2pass2' > > /usr/local/lib/libavcodec.a(libxvid_rc.o): In function > > `ff_xvid_rate_control_uninit': > > /home/sujoy/ffmpeg/libavcodec/libxvid_rc.c:146: undefined reference to > > `xvid_plugin_2pass2' > > /usr/local/lib/libavcodec.a(libxvid_rc.o): In function > > `ff_xvid_rate_estimate_qscale': > > /home/sujoy/ffmpeg/libavcodec/libxvid_rc.c:127: undefined reference to > > `xvid_plugin_2pass2' > > /home/sujoy/ffmpeg/libavcodec/libxvid_rc.c:119: undefined reference to > > `xvid_plugin_2pass2' > > /usr/local/lib/libavcodec.a(libxvid_rc.o): In function > > `ff_xvid_rate_control_init': > > /home/sujoy/ffmpeg/libavcodec/libxvid_rc.c:80: undefined reference to > > `xvid_plugin_2pass2' > > /usr/local/lib/libavcodec.a(pthread.o): In function > `avcodec_thread_free': > > /home/sujoy/ffmpeg/libavcodec/pthread.c:98: undefined reference to > > `pthread_join' > > /usr/local/lib/libavcodec.a(pthread.o): In function > `avcodec_thread_init': > > /home/sujoy/ffmpeg/libavcodec/pthread.c:173: undefined reference to > > `pthread_create' > > collect2: ld returned 1 exit status > > > > > > On Wed, Jun 30, 2010 at 3:42 PM, Tomas Härdin <[email protected] > > >wrote: > > > > > On Wed, 2010-06-30 at 01:13 +0800, S R wrote: > > > > Hi > > > > > > > > I keep getting this error as I try to compile a simple C++ code that > > > calls > > > > ffmpeg. > > > > > > > > /usr/local/include/libavutil/common.h: In function ‘int32_t > > > > av_clipl_int32(int64_t)’: > > > > /usr/local/include/libavutil/common.h:165: error: ‘UINT64_C’ was not > > > > declared in this scope > > > > > > > > Any idea what is wrong. I have installed the latest ffmpeg at this > > point > > > of > > > > time. But to no avail. The version I am using is > > > > > > > > FFmpeg version SVN-r23884, Copyright (c) 2000-2010 the FFmpeg > > developers > > > > built on Jun 30 2010 00:59:11 with gcc 4.3.3 > > > > configuration: --enable-gpl --enable-version3 --enable-nonfree > > > > --enable-postproc --enable-pthreads --enable-libfaac > > --enable-libmp3lame > > > > --enable-libtheora --enable-libvorbis --enable-libx264 > --enable-libxvid > > > > --enable-x11grab > > > > libavutil 50.19. 0 / 50.19. 0 > > > > libavcodec 52.78. 0 / 52.78. 0 > > > > libavformat 52.71. 0 / 52.71. 0 > > > > libavdevice 52. 2. 0 / 52. 2. 0 > > > > libavfilter 1.20. 1 / 1.20. 1 > > > > libswscale 0.11. 0 / 0.11. 0 > > > > libpostproc 51. 2. 0 / 51. 2. 0 > > > > FFmpeg SVN-r23884 > > > > libavutil 50.19. 0 / 50.19. 0 > > > > libavcodec 52.78. 0 / 52.78. 0 > > > > libavformat 52.71. 0 / 52.71. 0 > > > > libavdevice 52. 2. 0 / 52. 2. 0 > > > > libavfilter 1.20. 1 / 1.20. 1 > > > > libswscale 0.11. 0 / 0.11. 0 > > > > libpostproc 51. 2. 0 / 51. 2. 0 > > > > Any idea what is wrong. I saw in the website that CPPFLAGS need to be > > > added > > > > with > > > > > > > > *-D__STDC_CONSTANT_MACROS* > > > > > > > > But it also says that the latest SVN has this error corrected. > > > > > > > > Please advice. Thanks for your help. > > > > > > Just add -D__STDC_CONSTANT_MACROS to your CFLAGS or use gcc instead of > g > > > ++. The short story is that libav* are C libraries, not C++ libraries. > > > There are a bunch of threads in the FFmpeg-devel archives about this. > > > > > > /Tomas > > > > > > _______________________________________________ > > > libav-user mailing list > > > [email protected] > > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > > > > > _______________________________________________ > > libav-user mailing list > > [email protected] > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
