Linking libavformat in Visual Studio 2010

允我心安 提交于 2019-11-30 16:13:16

You need to do following all tasks to use libav with MSVC++. First goto Zeranoe

  1. Download Shared Version, Copy all .dll files from bin folder and paste them in the output directory where exe will be generated.
  2. Download Developer Version, Copy all .lib files from lib folder and paste them with your main c++ file is located (e.g. Folder-1\Folder-2 Where Folder-1 has the .sln file so you have to put .lib files in Folder-2)
  3. From Developer Version you downloaded in Step 2 copy all directories from include folder and paste them in Folder-2 (See details about Folder-2 in step 2)
  4. Download inttypes.h and stdint.h, save it on this location C:\Program Files\Microsoft Visual Studio 10.0\VC\include\ folder.
  5. To include header files use following syntax

You have to use this extern because libav is a C library.

extern "C" {
    #include "libavcodec/avcodec.h"
    #include "libavdevice/avdevice.h"
    #include "libavfilter/avfilter.h"
    #include "libavformat/avformat.h"
    #include "libavutil/avutil.h"
}

Fetch the 32-bit libraries and you should be fine :) Your application platform has to match the libraries used (and vica versa).

What about compiling it as a .lib static library?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!