webrtc报错:Unable to load:src/third_party/usrsctp/BUILD.gn

gn gen out/linux --args=‘is_debug=true target_os=“linux” target_cpu=“x64” is_clang=false treat_warnings_as_errors=false rtc_include_tests=false rtc_use_h264=true is_component_build=false use_custom_libcxx=false rtc_enable_protobuf=false use_rtti=true proprietary_codecs=true use_custom_libcxx_for_host=false’
ERROR at //media/BUILD.gn:438:7: Can’t load input file.
“//third_party/usrsctp”,
^----------------------
Unable to load:
/home/deviser/temp/webrtc-all/webrtc-checkout/src/third_party/usrsctp/BUILD.gn
I also checked in the secondary tree for:
/home/deviser/temp/webrtc-all/webrtc-checkout/src/build/secondary/third_party/usrsctp/BUILD.gn

笔者犯的错误是fetch --nohooks webrtc拉了最新的原码之后,执行了gclient sync。
后面又用git reset --hard 45a059997869e537bb9c47e8294c07d9d2618186切换到一个旧版本,然后再执行gn gen out/linux时报这个错误,错误是找不到src/third_party/usrsctp/BUILD.gn这个文件,打开文件夹发现根本没有usrsctp这个文件夹。
解决方法在src目录执行:

gclient sync

这是因为切换到旧版本后third_party没有跟旧版本保持一致,还是原来新版本的代码,此时只要执行gclient sync就好。因此git reset只是将本地的一部分代码改变了,third_party并没有改变,而gclient sync则是使本地的代码同远端这个版本的代码保持一致。

猜你喜欢

转载自blog.csdn.net/weixin_43466192/article/details/124271289