读书人

ffmpeg的lib函数调用有关问题出现连

发布时间: 2012-04-26 14:01:31 作者: rapoo

ffmpeg的lib函数调用问题,出现连接错误2019
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_open referenced in function "public: int __thiscall CAvcDecoder::InitDecoder(void)" (?InitDecoder@CAvcDecoder@@QAEHXZ)
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_alloc_frame referenced in function "public: int __thiscall CAvcDecoder::InitDecoder(void)" (?InitDecoder@CAvcDecoder@@QAEHXZ)
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_alloc_context referenced in function "public: int __thiscall CAvcDecoder::InitDecoder(void)" (?InitDecoder@CAvcDecoder@@QAEHXZ)
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_find_decoder referenced in function "public: int __thiscall CAvcDecoder::InitDecoder(void)" (?InitDecoder@CAvcDecoder@@QAEHXZ)
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_register_all referenced in function "public: int __thiscall CAvcDecoder::InitDecoder(void)" (?InitDecoder@CAvcDecoder@@QAEHXZ)
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_init referenced in function "public: int __thiscall CAvcDecoder::InitDecoder(void)" (?InitDecoder@CAvcDecoder@@QAEHXZ)
1>AvcDecoder.obj : error LNK2019: unresolved external symbol _avcodec_decode_video referenced in function "public: struct tagimage __thiscall CAvcDecoder::DecodeOneImage(unsigned char *)" (?DecodeOneImage@CAvcDecoder@@QAE?AUtagimage@@PAE@Z)
1>d:\My Documents\Visual Studio 2008\Projects\h264decoder\Debug\h264decoder.exe : fatal error LNK1120: 7 unresolved externals

编译时,出现上面的错误,用ffmpeg
extern "C"

{
#include ".\ffmpeg\avcodec.h"
}

#pragma comment(lib, ".\\ffmpeg\\libavcodec.lib")

avcodec.h声明与调用一致,不知道libavcodec.lib中什么情况?

[解决办法]
http://download.csdn.net/source/2916908
你可以下载这个试试,这个就是我以前用VS2008调用FFMPEG动态库例子。如果你这个没有问题,那就说明你的这个配置有问题

读书人网 >C++

热点推荐