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
shared
version, copy.dll
filesbin
folder , paste them in output directoryexe
generated. - download
developer
version, copy.lib
fileslib
folder , paste them main c++ file located (e.g.folder-1\folder-2
folder-1
has.sln
file have put.lib
files infolder-2
) - from
developer
version downloaded in step 2 copy directoriesinclude
folder , 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