c++ - Linking libavformat in Visual Studio 2010 -
i'm attempting build video-reading code around libavformat. after getting compiled dlls , .lib files here, go build code, , linker can't find of libavformat symbols though i've linked in provided .lib files.
inspecting libavformat.lib dumpbin -headers reveals exports desired functions underscore prefix. example, while want call avformat_open_input, .lib file gives _avformat_open_input.
why this, , why can't link precompiled dlls?
you need following tasks use libav msvc++. first goto zeranoe
- download
sharedversion, copy.dllfilesbinfolder , paste them in output directoryexegenerated. - download
developerversion, copy.libfileslibfolder , paste them main c++ file located (e.g.folder-1\folder-2folder-1has.slnfile have put.libfiles infolder-2) - from
developerversion downloaded in step 2 copy directoriesincludefolder , paste them in folder-2 (see details folder-2 in step 2) - download inttypes.h , stdint.h, save on location
c:\program files\microsoft visual studio 10.0\vc\include\folder. - to include header files use following syntax
you have use extern because libav c library.
extern "c" { #include "libavcodec/avcodec.h" #include "libavdevice/avdevice.h" #include "libavfilter/avfilter.h" #include "libavformat/avformat.h" #include "libavutil/avutil.h" }
Comments
Post a Comment