0
votes

With an ojective to record the animations of OpenGL output by statically

linked avlib libraries I followed th following steps.

  1. I have downloaded the libav-win32-20130921.7z file from http://win32.libav.org/win32/ and decompressed all the files in to a folder (d:/VC Projects/libav/). The lib sub-folder contains all the .a files (libavcodec.a, libavdevice.a, libavfilter.a, libavformat.a, libavresample.a, libavutil.a, libswscale.a and libavcodec.dll.a, libavdevice.dll.a, libavfilter.dll.a, libavformat.dll.a, libavresample.dll.a, libavutil.dll.a, libswscale.dll.a) in addition to 7 .def files.

  2. In my main header file I inserted the following code:

extern "C" 
{
#include <stdint.h>
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfilter.h>
#include <libavresample/avresample.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>

#pragma comment(lib, "D:/VC Projects/libav/lib/libavutil.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libswscale.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavfilter.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavresample.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavcodec.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavdevice.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavformat.a")
}
  1. In the project settings provided the additional include directories "D:\VC Projects\libav\include"

When I compile the project I get 316 errors and 31 warnings:

> libavcodec.a(pthread.o) : warning LNK4217: locally defined symbol
> __beginthreadex imported in function _ff_thread_init libavutil.a(avstring.o) : warning LNK4049: locally defined symbol
> __vsnprintf imported libavformat.a(aviobuf.o) : warning LNK4217: locally defined symbol __vsnprintf imported in function _avio_printf
> libavformat.a(rtpproto.o) : warning LNK4049: locally defined symbol
> __vsnprintf imported libavformat.a(url.o) : warning LNK4049: locally defined symbol __vsnprintf imported libavutil.a(log.o) : warning
> LNK4049: locally defined symbol __vsnprintf imported
> libavformat.a(mov.o) : warning LNK4217: locally defined symbol
> __gmtime64 imported in function _mov_read_mdhd libavformat.a(mxfenc.o) : warning LNK4217: locally defined symbol __gmtime64 imported in
> function _mxf_write_header libavformat.a(wtv.o) : warning LNK4217:
> locally defined symbol __gmtime64 imported in function
> _parse_media_type libavutil.a(parseutils.o) : warning LNK4049: locally defined symbol __gmtime64 imported libavformat.a(os_support.o) :
> warning LNK4049: locally defined symbol __errno imported
> libavutil.a(file_open.o) : warning LNK4049: locally defined symbol
> __errno imported libavformat.a(rtsp.o) : warning LNK4217: locally defined symbol __errno imported in function
> _udp_read_packet.constprop.5 libavformat.a(file.o) : warning LNK4049: locally defined symbol __errno imported libavformat.a(md5proto.o) :
> warning LNK4049: locally defined symbol __errno imported
> libavformat.a(network.o) : warning LNK4049: locally defined symbol
> __errno imported libavformat.a(file.o) : warning LNK4217: locally defined symbol __stat64 imported in function _file_check
> libavformat.a(md5proto.o) : warning LNK4217: locally defined symbol
> __iob imported in function _md5_close libavutil.a(log.o) : warning LNK4217: locally defined symbol __iob imported in function
> _av_log_default_callback libavutil.a(parseutils.o) : warning LNK4217: locally defined symbol __time64 imported in function _av_parse_time
> libavutil.a(parseutils.o) : warning LNK4217: locally defined symbol
> __mktime64 imported in function _av_parse_time libavutil.a(parseutils.o) : warning LNK4217: locally defined symbol
> __localtime64 imported in function _av_parse_time libavutil.a(file_open.o) : warning LNK4217: locally defined symbol
> __wsopen imported in function _avpriv_open libavutil.a(file_open.o) : warning LNK4217: locally defined symbol __sopen imported in function
> _avpriv_open libavformat.a(riffenc.o) : error LNK2001: unresolved external symbol ___divdi3 libavutil.a(mathematics.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavutil.a(rational.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavformat.a(xa.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavformat.a(xwma.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavformat.a(yop.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(cutils.o) : error LNK2001: unresolved
> external symbol ___divdi3 libavformat.a(rmdec.o) : error LNK2019:
> unresolved external symbol ___divdi3 referenced in function
> _rm_read_header libavformat.a(rtpenc.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(rtspdec.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(wtv.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavformat.a(nutenc.o)
> : error LNK2001: unresolved external symbol ___divdi3
> libavformat.a(nutdec.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavformat.a(pcmdec.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(rawvideodec.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(mpegtsenc.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavformat.a(mpegts.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavformat.a(mxfdec.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(nsvdec.o) : error LNK2001: unresolved
> external symbol ___divdi3 libavformat.a(mmf.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(mov.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavformat.a(mpc8.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavformat.a(mpegenc.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavformat.a(filmstripdec.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(flvenc.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(gsmdec.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavformat.a(iss.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavformat.a(dvenc.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavformat.a(dv.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(dxa.o) : error LNK2001: unresolved
> external symbol ___divdi3 libavformat.a(ffmdec.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(avienc.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavformat.a(avidec.o)
> : error LNK2001: unresolved external symbol ___divdi3
> libavformat.a(swfenc.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavformat.a(cafdec.o) : error LNK2001: unresolved external symbol ___divdi3 libavformat.a(adxdec.o) : error LNK2001: unresolved
> external symbol ___divdi3 libavformat.a(aiffenc.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(asfenc.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavformat.a(asfdec.o)
> : error LNK2001: unresolved external symbol ___divdi3
> libavcodec.a(error_resilience.o) : error LNK2001: unresolved external
> symbol ___divdi3 libavcodec.a(iirfilter.o) : error LNK2001: unresolved
> external symbol ___divdi3 libavformat.a(mux.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavformat.a(utils.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavcodec.a(wmaenc.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavcodec.a(xsubenc.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavcodec.a(libvpxenc.o) : error LNK2001: unresolved external symbol ___divdi3 libavcodec.a(ituh263enc.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavcodec.a(mpeg4videodec.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavcodec.a(ac3enc_fixed.o) : error LNK2001: unresolved external
> symbol ___divdi3 libavcodec.a(mpegaudiodec.o) : error LNK2001:
> unresolved external symbol ___divdi3
> libavcodec.a(mpegaudiodec_float.o) : error LNK2001: unresolved
> external symbol ___divdi3 libavcodec.a(h261enc.o) : error LNK2001:
> unresolved external symbol ___divdi3 libavcodec.a(mpegvideo_enc.o) :
> error LNK2001: unresolved external symbol ___divdi3
> libavcodec.a(mpeg12enc.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavcodec.a(mpeg4videoenc.o) : error LNK2001: unresolved external symbol ___divdi3 libswscale.a(utils.o) : error LNK2001:
> unresolved external symbol ___divdi3 libswscale.a(yuv2rgb.o) : error
> LNK2001: unresolved external symbol ___divdi3 libavcodec.a(ffv1enc.o)
> : error LNK2001: unresolved external symbol ___divdi3
> libavcodec.a(flvenc.o) : error LNK2001: unresolved external symbol
> ___divdi3 libavutil.a(avstring.o) : error LNK2001: unresolved external symbol _snprintf libavutil.a(error.o) : error LNK2001: unresolved
> external symbol _snprintf libavutil.a(log.o) : error LNK2001:
> unresolved external symbol _snprintf libavutil.a(opt.o) : error
> LNK2001: unresolved external symbol _snprintf
> libavutil.a(channel_layout.o) : error LNK2001: unresolved external
> symbol _snprintf libavutil.a(samplefmt.o) : error LNK2001: unresolved
> external symbol _snprintf libavformat.a(id3v2.o) : error LNK2001:
> unresolved external symbol _snprintf libavformat.a(id3v1.o) : error
> LNK2001: unresolved external symbol _snprintf
> libavformat.a(httpauth.o) : error LNK2001: unresolved external symbol
> _snprintf libavutil.a(pixdesc.o) : error LNK2001: unresolved external symbol _snprintf libavformat.a(md5proto.o) : error LNK2001: unresolved
> external symbol _snprintf libavformat.a(rtpproto.o) : error LNK2001:
> unresolved external symbol _snprintf libavformat.a(tcp.o) : error
> LNK2001: unresolved external symbol _snprintf libavformat.a(udp.o) :
> error LNK2001: unresolved external symbol _snprintf
> libavformat.a(gopher.o) : error LNK2001: unresolved external symbol
> _snprintf libavformat.a(http.o) : error LNK2001: unresolved external symbol _snprintf libavformat.a(mmsh.o) : error LNK2001: unresolved
> external symbol _snprintf libavformat.a(mmst.o) : error LNK2001:
> unresolved external symbol _snprintf libavformat.a(vqf.o) : error
> LNK2001: unresolved external symbol _snprintf libavformat.a(wavdec.o)
> : error LNK2001: unresolved external symbol _snprintf
> libavformat.a(wtv.o) : error LNK2001: unresolved external symbol
> _snprintf libavformat.a(yuv4mpeg.o) : error LNK2001: unresolved external symbol _snprintf libavformat.a(mpjpeg.o) : error LNK2001:
> unresolved external symbol _snprintf libavformat.a(rtsp.o) : error
> LNK2019: unresolved external symbol _snprintf referenced in function
> _ff_rtsp_connect libavformat.a(rtspdec.o) : error LNK2001: unresolved external symbol _snprintf libavformat.a(smoothstreamingenc.o) : error
> LNK2001: unresolved external symbol _snprintf libavformat.a(movenc.o)

..........

error LNK2001: unresolved external symbol _snprintf libavcodec.a(ass.o) : error LNK2001: unresolved external symbol _snprintf libavformat.a(utils.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(pnmenc.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(xbmenc.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(srtdec.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(xsubenc.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(utils.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(ffv1enc.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(huffyuvenc.o) : error LNK2001: unresolved external symbol _snprintf libavcodec.a(pamenc.o) : error LNK2001: unresolved external symbol snprintf libavformat.a(rtpproto.o) : error LNK2019: unresolved external symbol __chkstk_ms referenced in function _rtp_write libavformat.a(smoothstreamingenc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(wtv.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(gopher.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(http.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(rtsp.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(rtspenc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(rtspdec.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(sapdec.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(mpegaudiodsp.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(aviobuf.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(hls.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(mpegts.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(aaccoder.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(kbdwin.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(aacpsy.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(aacps.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(mpegvideo.o) : error LNK2001: unresolved external symbol .......... libavcodec.a(jpeg2000dec.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(jpeglsenc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(svq1enc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(utvideoenc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(huffyuvdec.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(4xm.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(fraps.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(mpegvideo_enc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(dnxhdenc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(dv.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(dvdec.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavcodec.a(ffv1enc.o) : error LNK2001: unresolved external symbol ___chkstk_ms libavformat.a(xwma.o) : error LNK2001: unresolved external symbol __udivdi3 libavformat.a(oggparseogm.o) : error LNK2001: unresolved external symbol __udivdi3 libavformat.a(nutdec.o) : error LNK2019: unresolved external symbol ___udivdi3 referenced in function _nut_read_header libavformat.a(r3d.o) : error LNK2001: unresolved external symbol __udivdi3 libavformat.a(tty.o) : error LNK2001: unresolved external symbol __udivdi3 libavformat.a(wavdec.o)

> referenced in function _mp3lame_encode_init libavcodec.a(libmp3lame.o)
> : error LNK2019: unresolved external symbol _lame_get_encoder_delay
> referenced in function _mp3lame_encode_init libavcodec.a(libmp3lame.o)
> : error LNK2019: unresolved external symbol _lame_get_framesize
> referenced in function _mp3lame_encode_init libavcodec.a(libmp3lame.o)
> : error LNK2019: unresolved external symbol _lame_encode_buffer_float
> referenced in function _mp3lame_encode_frame
> libavcodec.a(libmp3lame.o) : error LNK2019: unresolved external symbol
> _lame_encode_buffer referenced in function _mp3lame_encode_frame libavcodec.a(libmp3lame.o) : error LNK2019: unresolved external symbol
> _lame_encode_buffer_int referenced in function _mp3lame_encode_frame libavcodec.a(libmp3lame.o) : error LNK2019: unresolved external symbol
> _lame_encode_flush referenced in function _mp3lame_encode_frame libavcodec.a(libvo-aacenc.o) : error LNK2019: unresolved external
> symbol _cmnMemAlloc referenced in function _aac_encode_init
> libavcodec.a(libvo-aacenc.o) : error LNK2019: unresolved external
> symbol _cmnMemCopy referenced in function _aac_encode_init
> libavcodec.a(libvo-aacenc.o) : error LNK2019: unresolved external
> symbol _cmnMemFree referenced in function _aac_encode_init
> libavcodec.a(libvo-aacenc.o) : error LNK2019: unresolved external
> symbol _cmnMemSet referenced in function _aac_encode_init
> libavcodec.a(libvo-aacenc.o) : error LNK2019: unresolved external
> symbol _cmnMemCheck referenced in function _aac_encode_init
> libavcodec.a(libvo-aacenc.o) : error LNK2019: unresolved external
> symbol _voGetAACEncAPI referenced in function _aac_encode_init
> libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_analysis_wrote referenced in function _oggvorbis_encode_frame libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_block_clear referenced in function _oggvorbis_encode_close libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_dsp_clear referenced in function _oggvorbis_encode_close libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_info_clear referenced in function _oggvorbis_encode_close libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_analysis_buffer referenced in function _oggvorbis_encode_frame libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_analysis_blockout referenced in function _oggvorbis_encode_frame libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol _vorbis_analysis referenced in function
> _oggvorbis_encode_frame libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol _vorbis_bitrate_addblock referenced in
> function _oggvorbis_encode_frame libavcodec.a(libvorbis.o) : error
> LNK2019: unresolved external symbol _vorbis_bitrate_flushpacket
> referenced in function _oggvorbis_encode_frame
> libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_info_init referenced in function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_encode_setup_vbr referenced in function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_encode_setup_managed referenced in function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol _vorbis_encode_ctl referenced in function
> _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol _vorbis_encode_setup_init referenced in
> function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error
> LNK2019: unresolved external symbol _vorbis_analysis_init referenced
> in function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error
> LNK2019: unresolved external symbol _vorbis_block_init referenced in
> function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error
> LNK2019: unresolved external symbol _vorbis_comment_init referenced in
> function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error
> LNK2019: unresolved external symbol _vorbis_comment_add_tag referenced
> in function _oggvorbis_encode_init libavcodec.a(libvorbis.o) : error
> LNK2019: unresolved external symbol _vorbis_analysis_headerout
> referenced in function _oggvorbis_encode_init
> libavcodec.a(libvorbis.o) : error LNK2019: unresolved external symbol
> _vorbis_comment_clear referenced in function _oggvorbis_encode_init libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol
> _vpx_codec_vp8_cx_algo referenced in function _vp8_init libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol
> _vpx_codec_error referenced in function _log_encoder_error libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol
> _vpx_codec_error libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol _vpx_codec_error_detail referenced in function
> _log_encoder_error libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol _vpx_codec_error_detail
> libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol
> _vpx_codec_control_ referenced in function _codecctl_int libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol
> _vpx_codec_destroy referenced in function _vp8_free libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol
> _vpx_codec_destroy libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol _vpx_codec_version_str referenced in
> function _vp8_init libavcodec.a(libvpxdec.o) : error LNK2001:
> unresolved external symbol _vpx_codec_version_str
> libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol
> _vpx_codec_build_config referenced in function _vp8_init libavcodec.a(libvpxdec.o) : error LNK2001: unresolved external symbol
> _vpx_codec_build_config libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol _vpx_codec_enc_config_default referenced in
> function _vp8_init libavcodec.a(libvpxenc.o) : error LNK2019:
> unresolved external symbol _vpx_codec_err_to_string referenced in
> function _vp8_init libavcodec.a(libvpxenc.o) : error LNK2019:
> unresolved external symbol _vpx_codec_enc_init_ver referenced in
> function _vp8_init libavcodec.a(libvpxenc.o) : error LNK2019:
> unresolved external symbol _vpx_img_wrap referenced in function
> _vp8_init libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol _vpx_codec_encode referenced in function _vp8_encode
> libavcodec.a(libvpxenc.o) : error LNK2019: unresolved external symbol
> _vpx_codec_get_cx_data referenced in function _vp8_encode libavcodec.a(libvpxdec.o) : error LNK2019: unresolved external symbol
> _vpx_codec_vp8_dx_algo referenced in function _vp8_init libavcodec.a(libvpxdec.o) : error LNK2019: unresolved external symbol
> _vpx_codec_decode referenced in function _vp8_decode libavcodec.a(libvpxdec.o) : error LNK2019: unresolved external symbol
> _vpx_codec_get_frame referenced in function _vp8_decode libavcodec.a(libvpxdec.o) : error LNK2019: unresolved external symbol
> _vpx_codec_dec_init_ver referenced in function _vp8_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_bit_depth referenced in function _X264_frame libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_encoder_close referenced in function _X264_close libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_param_default referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_param_default_preset referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_param_parse referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_param_apply_fastfirstpass referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_param_apply_profile referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_encoder_open_125 referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_encoder_headers referenced in function _X264_init libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_picture_init referenced in function _X264_frame libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_encoder_reconfig referenced in function _X264_frame libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_encoder_encode referenced in function _X264_frame libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol
> _x264_encoder_delayed_frames referenced in function _X264_frame libavcodec.a(aacsbr.o) : error LNK2019: unresolved external symbol
> _exp2f referenced in function _ff_sbr_apply libavcodec.a(acelp_pitch_delay.o) : error LNK2001: unresolved external
> symbol _exp2f libavcodec.a(aacpsy.o) : error LNK2019: unresolved
> external symbol _atanf referenced in function _calc_bark
> libavcodec.a(aacps.o) : error LNK2001: unresolved external symbol
> _atanf libavformat.a(smoothstreamingenc.o) : error LNK2019: unresolved external symbol __imp___mkdir referenced in function _ism_write_header
> libavformat.a(wavenc.o) : error LNK2019: unresolved external symbol
> _strtoll referenced in function _wav_write_header libavformat.a(http.o) : error LNK2001: unresolved external symbol
> _strtoll libavutil.a(channel_layout.o) : error LNK2001: unresolved external symbol _strtoll libavformat.a(file.o) : error LNK2019:
> unresolved external symbol __imp___fstat64 referenced in function
> _file_seek libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol _RTMP_Socket referenced in function
> _rtmp_get_file_handle libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol _RTMP_SendSeek referenced in function
> _rtmp_read_seek libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol _RTMP_Pause referenced in function _rtmp_read_pause
> libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol
> _RTMP_Close referenced in function _rtmp_close libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol
> _RTMP_Write referenced in function _rtmp_write libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol
> _RTMP_Read referenced in function _rtmp_read libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol _RTMP_LogSetLevel
> referenced in function _rtmp_open libavformat.a(librtmp.o) : error
> LNK2019: unresolved external symbol _RTMP_LogSetCallback referenced in
> function _rtmp_open libavformat.a(librtmp.o) : error LNK2019:
> unresolved external symbol _RTMP_Init referenced in function
> _rtmp_open libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol _RTMP_SetupURL referenced in function _rtmp_open
> libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol
> _RTMP_Connect referenced in function _rtmp_open libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol
> _RTMP_ConnectStream referenced in function _rtmp_open libavformat.a(librtmp.o) : error LNK2019: unresolved external symbol
> _RTMP_EnableWrite referenced in function _rtmp_open libavutil.a(parseutils.o) : error LNK2019: unresolved external symbol
> ___strtod referenced in function _av_parse_color libavutil.a(eval.o) : error LNK2001: unresolved external symbol ___strtod
> libavutil.a(eval.o) : error LNK2019: unresolved external symbol _trunc
> referenced in function _eval_expr libavutil.a(time.o) : error LNK2019:
> unresolved external symbol _gettimeofday referenced in function
> _av_gettime libavutil.a(time.o) : error LNK2019: unresolved external symbol _usleep referenced in function _av_usleep

To use the dynamic linking, I copied all the .dll files to the debug floder (where the main executable is created) and changed the main header as follows:

extern "C" 
{
#include <stdint.h>
#include <libavcodec/avcodec.h>
#include <libavfilter/avfilter.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfilter.h>
#include <libavresample/avresample.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>

#pragma comment(lib, "D:/VC Projects/libav/lib/libavutil.dll.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libswscale.dll.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavfilter.dll.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavresample.dll.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavcodec.dll.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavdevice.dll.a")
#pragma comment(lib, "D:/VC Projects/libav/lib/libavformat.dll.a")
}

The project compiled without any error. But while executing it shows an error message "The procedure entry point sws_getContext could not be located in the dynamic link library avutil-52.dll" and exits.

My first objective of linking the static libraries falied so also the dynamic linking.

I am using Visual Studio 2008 and the operating system is Windows XP.

Can someone figureout where I am committing any mistake(s)?

Pani.

2
Please don't just dump a ton of error messages like this, an exemplary error message is usually enough, and selecting one helps you to pose questions that are much more to the point. Remember that people have to read your question before they can answer...cmaster - reinstate monica
Sorry for that. I won't repeat it. However, I wanted to upload the buildlog but could not find a way to do so.user2823001
Did you ever fix this? I'm having the same problem where it's looking for sws imports in avutil-52.dll.SilverbackNet

2 Answers

1
votes

You need the .lib and the .dll files of the libav project. Unfortunately, they are not delivered with libav but must be manually built.

Fortunately you can download them from this page.

  • The .dll files are in the shared packages (bin directory within the archive)
  • The .lib files are in the dev packages (lib directory)
1
votes

Well, I think I found the solution. You have to link to the swscale.lib, avutil.lib, etc files. The libx.dll.a files don't always work correctly with MSVC.