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

  1. download shared version, copy .dll files bin folder , paste them in output directory exe generated.
  2. download developer version, copy .lib files lib folder , paste them main c++ file located (e.g. folder-1\folder-2 folder-1 has .sln file have put .lib files in folder-2)
  3. from developer version downloaded in step 2 copy directories include folder , paste them in folder-2 (see details folder-2 in step 2)
  4. download inttypes.h , stdint.h, save on location c:\program files\microsoft visual studio 10.0\vc\include\ folder.
  5. 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

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -