webcrt编译错误集锦

时间:2022-10-13 15:01:30

错误:

 yasm gperf for C:\Users\melcu\Desktop\webrtc\trunk\build\Debug\obj\global_intermediate\third_party\yasm\x86insn_gas.gperf.
10>  Could not open `C:/Users/melcu/Desktop/webrtc/trunk/build/Debug/obj/global_intermediate/third_party/yasm/x86insn_gas.gperf' for reading
10>C:\Users\melcu\Desktop\webrtc\trunk\third_party\yasm\yasm.targets(1,2021): 
 
error MSB3721: The command "call "C:\Users\melcu\Desktop\webrtc\trunk\third_party\yasm\..\..\third_party\cygwin\setup_env.bat" && set CYGWIN=nontsec&& set INTDIR=C:\Users\melcu\Desktop\webrtc\trunk\Debug\obj\yasm\&& set OUTDIR=../..\build\Debug\&& set INPUTPATH=C:\Users\melcu\Desktop\webrtc\trunk\build\Debug\obj\global_intermediate\third_party\yasm\x86insn_gas.gperf && bash -c "\"`cygpath -m \"${OUTDIR}\"`/genperf\" \"`cygpath -m \"${INPUTPATH}\"`\" \"`cygpath -m \"${INTDIR}\"`/third_party/yasm/x86insn_gas.c\""" exited with code 1.

解决办法:

原文:http://code.google.com/p/webrtc/issues/detail?id=197

Update: looks like x86insn_gas.gperf and x86insn_nasm.gperf are in my 'trunk/third_party/yasm/source/patched-yasm' dir but the yasm build expects them to be in 'trunk/build/[Debug/Release]/obj/global_intermediate/third_party/yasm' dir. Putting them there manually yields a successful yasm and libvpx build now :) haven't dug deep enough yet to know why they are being generated to the wrong folders but at least this is a workaround for us. 
即手动拷贝patched-yasm中的x86insn_gas.gperf和x86insn_nasm.gperf文件,然后点击编译,不要点击重新编译。



编译时,error C2977 "std::tuple" too many template arguments问题的解决办法

网文http://www.cnblogs.com/fresky/articles/2455058.html中的方案如下:

打开 c:\program files (x86)\Microsoft Visual Studio 11.0\VC\include\xstddef,把 _VARIADIC_MAX定义成10。

这个方案一方面需要Administrator,其实是需要System权限才能修改Windows 8中的System文件,另一方面,会对所有的C/C++代码造成影响


其实,更简单的方法是打开“解决方案资源管理器”,右键打开项目“属性”,在C/C++ --> “预处理器”--> “预处理定义”中增加以下行即可:


_VARIADIC_MAX=10



下载出错:


解决办法不要下载资源文件:

I have the same problem on Mac. My network speed is 400k/s when running download_from_google_storage, which is not so bad.
In my case, I didn't need resources files, so I simply commented these lines in trunk/DEPS :

  # {
  #   # Download test resources, i.e. video and audio files from Google Storage.
  #   "pattern": "\\.sha1",
  #   "action": ["download_from_google_storage",
  #              "--directory",
  #              "--recursive",
  #              "--num_threads=10",
  #              "--bucket", "chromium-webrtc-resources",
  #              Var("root_dir") + "/resources"],
  # },

And then:
gclient sync --force
The sync succeeded, though the trunk/resources is empty.
 
工具链错误如can't find tool chains  或者  current_hash:desired_hashes 不匹配 ,首先查看VS2012  vs2013  和 WIN 8  SDK  等工具是否默认方式安装好,然后解决办法如下:
set DEPOT_TOOLS_WIN_TOOLCHAIN=1  
set GYP_GENERATORS=ninja
或者
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_GENERATORS=msvs
set GYP_MSVS_VERSION=2013


错误:

fatal error C1083: Cannot open include file: ‘ammintrin.h’: No such file or directory

Searching Google for the answer I found only one link in Russian. Russian developer says, he have reinstalled Visual Studio. Tried to search MS Connect again, and found: Windows Update KB2455033 breaks build with missing ammintrin.h.

The workaround is to install Visual Studio 2010 SP1. Download it form Microsoft Website: Microsoft Visual Studio 2010 Service Pack 1 (Installer).

意思是:需要安装 Microsoft Visual Studio 2010 Service Pack 1 (Installer).



错误:

VC 2005 & VC 2008 error C2220: warning treated as error - no object file generated

在编译开关里拿掉 properties->c/c++->Treat Warinings As errors  /WX   开关

错误:
 error LNK2019: unresolved external symbol _intel_aes_encrypt_init_128 referenced in function _aes_InitContext
解决办法:
在trunk\third_party\nss\nss.gyp目录中注释掉USE_HW_AES和INTEL_GCM


错误:

解决办法:

vs2010编译chromium的时候出现如下问题 : 

bash:../../third_party/libvpx/copy_obj.sh: /bin/bash: bad interpreter: No such file or directory

microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" 已退出, 代码为126

如果出现这个问题

webcrt编译错误集锦

可以使用源代码下的E:\chromium\src\third_party\cygwin\setup_mount.bat,解决 ,双击此文件即可。

执行完后,清理工程,再次编译,如果出现如下问题:

11>  copy_enc_offsets_obj
12>------ 已启动生成: 项目: generate_files, 配置: Debug Win32 ------
12>  Running source/patched-yasm/modules/arch/x86/gen_x86_insn.py.
11>  ../../third_party/libvpx/copy_obj.sh: line 6: $'\r': command not found
11>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: “cmd.exe”已退出,代码为 127。

webcrt编译错误集锦


可以使用UltraEdit ->“文件”->“转换”->“Dos转Unix” (编辑copy_obj.sh文件),“保存”,再次清理工程,然后编译,(其实上面的问题都是因为不同操作系统下,文件的中回车/换行标示方法引起的,找个工具转换下就ok了)

问题就解决了,哈哈,