教你一步一步build通libjingle

来源:互联网 发布:淘宝代购怎么开店 编辑:程序博客网 时间:2024/05/21 08:47
libjingle是一个开源的C++库,可以用它编写点对点的音、视频及文件共享的应用程序。它处理连接协商和数据交换。
libjingle的源代码可以在以下站点下载:
http://code.google.com/p/libjingle/downloads/list
我下载的是0.4.0的
解压后找到一个README.win的文件,这个文本文件是在WINDOWS环境下的使用说明,但存在不少问题:
1,工程用VC++EXpress 2005, 需网上下载安装。(下载地址(繁体和英文):http://www.microsoft.com/taiwan/vstudio/express/visualc/download/)
注:该工程不能转换成VS2005!
2,VC++EXpress 2005与VS2005不兼容,不能同时安装!为了使用它,不得不用另外一台机器来单独安装。这也是不能转换成VS2005工程的原因所在
3,要下载Windows 2003 server SP1或R2的SDK(下载地址(ISO Install package):http://www.microsoft.com/en-us/download/details.aspx?id=15656)
4,其自诩完全代码是不正确的:
a,expat包不在此下载包里,需要单独下载安装!(我下的是2.10的)

b,GIPS Voice Engine Lite已不被支持,该SDK在网上极难寻找,并且其分发的动态链接库有时间限制,且已经早早过了其限期-2010.2.15!

c,release配置下,需要的GLib库缺失,oRTP库也缺失

5,以上全具备的条件下,VC++EXpress 2005可将libjingle的工程编译链接成功(仅debug配置),但另外2个demo:call和pcp编译可过,但链接时出现问题,报以下错误:

1>------ Build started: Project: pcp, Configuration: Debug Win32 ------
2>------ Build started: Project: call, Configuration: Debug Win32 ------
1>Linking...
2>Linking...
2>libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
2>libjingle.lib(helpers1.obj) : error LNK2019: unresolved external symbol __imp__CryptReleaseContext@8 referenced in function "void __cdecl cricket::InitRandom(char const *,unsigned int)" (?InitRandom@cricket@@YAXPBDI@Z)
2>libjingle.lib(helpers1.obj) : error LNK2019: unresolved external symbol __imp__CryptGenRandom@12 referenced in function "void __cdecl cricket::InitRandom(char const *,unsigned int)" (?InitRandom@cricket@@YAXPBDI@Z)
2>libjingle.lib(helpers1.obj) : error LNK2019: unresolved external symbol __imp__CryptAcquireContextW@20 referenced in function "void __cdecl cricket::InitRandom(char const *,unsigned int)" (?InitRandom@cricket@@YAXPBDI@Z)
2>libjingle.lib(pathutils.obj) : error LNK2019: unresolved external symbol __imp__SHGetSpecialFolderPathW@16 referenced in function "bool __cdecl talk_base::GetAppDataFolder(class talk_base::Pathname &,bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetAppDataFolder@talk_base@@YA_NAAVPathname@1@_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
2>libjingle.lib(pathutils.obj) : error LNK2019: unresolved external symbol __imp__SHFileOperationW@4 referenced in function "bool __cdecl talk_base::CleanupTemporaryFolder(void)" (?CleanupTemporaryFolder@talk_base@@YA_NXZ)
2>E:\OY\libjingle-0.4.0\talk\Debug\call.exe : fatal error LNK1120: 5 unresolved externals
1>libjingle.lib(pathutils.obj) : error LNK2019: unresolved external symbol __imp__SHGetSpecialFolderPathW@16 referenced in function "bool __cdecl talk_base::GetAppDataFolder(class talk_base::Pathname &,bool,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?GetAppDataFolder@talk_base@@YA_NAAVPathname@1@_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>libjingle.lib(pathutils.obj) : error LNK2019: unresolved external symbol __imp__SHFileOperationW@4 referenced in function "bool __cdecl talk_base::CleanupTemporaryFolder(void)" (?CleanupTemporaryFolder@talk_base@@YA_NXZ)
1>libjingle.lib(helpers1.obj) : error LNK2019: unresolved external symbol __imp__CryptReleaseContext@8 referenced in function "void __cdecl cricket::InitRandom(char const *,unsigned int)" (?InitRandom@cricket@@YAXPBDI@Z)
1>libjingle.lib(helpers1.obj) : error LNK2019: unresolved external symbol __imp__CryptGenRandom@12 referenced in function "void __cdecl cricket::InitRandom(char const *,unsigned int)" (?InitRandom@cricket@@YAXPBDI@Z)
1>libjingle.lib(helpers1.obj) : error LNK2019: unresolved external symbol __imp__CryptAcquireContextW@20 referenced in function "void __cdecl cricket::InitRandom(char const *,unsigned int)" (?InitRandom@cricket@@YAXPBDI@Z)
1>E:\OY\libjingle-0.4.0\talk\Debug\pcp.exe : fatal error LNK1120: 5 unresolved externals
2>Build log was saved at "file://e:\OY\libjingle-0.4.0\talk\examples\call\Debug\BuildLog.htm"
2>call - 6 error(s), 1 warning(s)
1>Build log was saved at "file://e:\OY\libjingle-0.4.0\talk\examples\pcp\Debug\BuildLog.htm"
1>pcp - 6 error(s), 1 warning(s)
========== Build: 0 succeeded, 2 failed, 1 up-to-date, 0 skipped ==========

解决的办法是在这2个工程中添加shell32.lib和advapi32.lib这2个import lib,见下图:


rebuild solution, 所有3个工程全部编译链接成功!开始你的P2P之旅吧:)


Good luck
原创粉丝点击