webRTC在Win7 VS2013上的编译

一、辅助工具下载与安装
1. VS2013
可以从这里下载各种版本:
http://www.musnow.com/thread-54-1-1.html
我选择的英文旗舰版


这里有可用的密钥:
http://www.wxzzz.com/307.html


下载并安装 VS2013 update5
可以参见这个文档:
http://jingyan.baidu.com/article/3c48dd349a9616e10be3583d.html


2. SVN
下载TortoiseSVN工具
http://sourceforge.net/projects/tortoisesvn/


3. GIT
下载TortoiseSVN工具
http://sourceforge.net/projects/tortoisesvn/


4. 下载安装SDK 7.1和directx
SDK 7.1:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279


DirectX SDK:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=6812


5 WDK
从微软的官网下载,并安装。
在很多项目中会用到atlthunk.lib文件,新建WDK_DIR系统环境变量值为WDK的安装目录,
例如C:\WinDDK\7600.16385.1\lib\ATL\i386。修改后需要重启VS


6. IE10
这个是需要的。


7. python
安装Python,然后把python安装目录加入到系统PATH的环境变量中,修改后需要重启VS,
从下面的网址下载并安装:
https://www.python.org/ftp/python/2.7.9/python-2.7.9.amd64.msi


二、depot_tools
取得depot_tools, 选择以下方式:
 . 只读签出(如果你不打算立刻提交你改动过的代码,你应该选择这个):
   svn checkout https://src.chromium.org/svn/trunk/tools/depot_tools      


把depot_tools目录加入你的环境变量中:
如果有管理员的访问权限:
  Control Panel > System and Security > System > Advanced system settings
  Modify the PATH system variable to include depot_tools




如果没有管理员的访问权限:
Control Panel > User Accounts > User Accounts > Change my environment variables
Add a PATH user variable: %PATH%;C:\path\to\depot_tools


三、代码下载并编译
编译之前要更改系统的语言
在控制面板中找到区域和语音->管理->非Unicode程序的语言->英语 


1. 代码下载
可以使用翻墙代理下,如何下可以见网文,挺麻烦的,主要的原因是VPN不稳定;


我用的这个,亲测可用。
webrtc-9540-d92f267-windows.zip的下载地址为:
http://yunpan.cn/cQ7mDkHtQFds7  访问密码 f514


然后vs2013打开webrtc-9540-d92f267-windows\src里面的all.sln就OK了。
编译的都是小问题。网上都可以解决






2. 错误提示:
Error 1 error LNK1104: cannot open file 
'D:\webrtc\google_native\webrtcInWin7\webrtc-9540-d92f267-windows\src\build\Debug\lib\system_wrappers_default.lib'
D:\webrtc\google_native\webrtcInWin7\webrtc-9540-d92f267-windows\src\webrtc\tools\LINK force_mic_volume_max


解决办法:
是因为工程没有导出类,在工程 system_wrappers_default  下添加如下两个文件:
// system_wrappers_default_test.h
extern "C" __declspec(dllexport) class system_wrappers_default_test
{
public:
system_wrappers_default_test();
~system_wrappers_default_test();
};




// system_wrappers_default_test.cpp
#include "system_wrappers_default_test.h"  


system_wrappers_default_test::system_wrappers_default_test()
{
}




system_wrappers_default_test::~system_wrappers_default_test()
{
}


或者:
到src\build\Debug\lib 目录下。
把编译出来的system_wrappers.lib复制一份并改名为 system_wrappers_default.lib


3. 错误提示:
Error 2 error LNK1104: cannot open file 
'D:\webrtc\google_native\webrtcInWin7\webrtc-9540-d92f267-windows\src\build\Debug\lib\gtest_prod.lib' 
D:\webrtc\google_native\webrtcInWin7\webrtc-9540-d92f267-windows\src\talk\LINK peerconnection_client


解决办法:
其实是因为gtest_prod这个工程没有导出类,所以其就不生成lib,
所以,可以在gtest_prod工程下添加下面的两文件,导出类就OK了。


如下:
// Test123.h  
extern "C" __declspec(dllexport) class Test123  
{  
public:  
    Test123();  
    ~Test123();  
};  
  
  
// Test123.cpp  
#include "Test123.h"  
  
Test123::Test123()  
{  
}  
  
  
Test123::~Test123()  
{  



4. 错误提示
error MSB3721: 命令“call python "..\..\tools\swarming_client\isolate.py" "check" 
"--result" "..\..\build\Debug\common_audio_unittests.isolated" "--isolate" 
"common_audio_unittests.isolate" "--path-variable" "DEPTH" "..\.." 
"--path-variable" "PRODUCT_DIR" "..\..\build\Debug\ " "--config-variable" 
"OS=win" "--config-variable" "chromeos=0" "--config-variable" "component=static_library"
 "--config-variable" "internal_gles2_conform_tests=0" "--config-variable" "icu_use_data_file_flag=1"
 "--config-variable" "use_openssl=0"”已退出,返回代码为 1。


解决办法:
在控制面板中找到区域和语音->管理->非Unicode程序的语言->英语 


5. 错误提示
编译yasm--generate_files工程时 出现“error MSB6006: “cmd.exe”已退出,代码为 1。” 


解决办法:
修改.\webrtc-9540-d92f267-windows\src\third_party\yasm\source\patched-yasm\modules\arch\x86\gen_x86_insn.py 
把file改成open


参考文档:
name 'file' is not defined 


when compile the third-party of webRTC
there meet a problem.(It caused by me istalled a single python which version is just 3.11)
complie output is name 'file' is not defined
for this sentence "output_groups(file(os.path.join(out_dir, "x86insns.c"), "wt"))"
-------------------------------------------------------------------------------------------
there is a article about this problem
http://www.189works.com/article-65435-1.html
python版本3.11
源码:
poem = '''\
Programming is fun
When the work is done
if you wanna make your work also fun:
use Python!
'''
f = file('poem.txt', 'w') # open for 'w'riting
f.write(poem) # write text to file
f.close() # close the file
f = file('poem.txt')
# if no mode is specified, 'r'ead mode is assumed by default
while True:
line = f.readline()
if len(line) == 0: # Zero length indicates EOF
break
print (line),
# Notice comma to avoid automatic newline added by Python
f.close() # close the file
错误提示:
Traceback (most recent call last):
File "C:/Python31/004.py", line 8, in <module>
f = file('poem.txt', 'w') # open for 'w'riting
NameError: name 'file' is not defined
解决办法:file()改为open()
---------------------------------------------------------------------------------------------------------
I simplely resolved it by removed the python path which added by myself in the ms common properties.


此问题与python版本有关


6. 错误提示
error LNK2005: "class ATL::CAtlWinModule ATL::_AtlWinModule" 
(?_AtlWinModule@ATL@@3VCAtlWinModule@1@A) 已经在 libjingle_media.lib(win32devicemanager.obj) 中定义。


解决办法:在peerconnection_client项目的链接器->命令行中加入:/FORCE:MULTIPLE
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值