我试图围绕打造了libavformat一些视频读取代码链接了libavformat。获得编译的DLL和.lib
文件here后,我建立我的代码,链接器无法找到任何即使我在所提供的.lib
文件已关联了libavformat符号。在Visual Studio 2010
检查libavformat.lib
与dumpbin -headers
显示它将带有下划线前缀的所需函数导出。例如,虽然我想呼叫avformat_open_input
,但.lib文件给出了_avformat_open_input
。
这是为什么,为什么我不能链接预编译的dll?
是您的应用x64平台呢?也请在这里复制确切的错误信息。 – hege
我只是建立一个32位应用程序。链接器错误只是您的传统 LibavVideoReader.obj:错误LNK2019:无法解析的外部符号“int __cdecl avformat_open_input(struct AVFormatContext * *,char const *,struct AVInputFormat *,struct AVDictionary * *)”(?avformat_open_input @@ YAHPAPAUAVFormatContext @ @ PBDPAUAVInputFormat @@ PAPAUAVDictionary @@@ Z)在函数中引用... 消息 –
您是否将代码编译为C或C++?如果是后者,你确定这些库中的C声明是否包含在'extern“C”'中? – ildjarn