【问题标题】:native WebRTC with Visual Studio build error带有 Visual Studio 构建错误的本机 WebRTC
【发布时间】:2019-01-08 07:39:30
【问题描述】:

我已成功构建原生 WebRTC 并在结果中获得了 webrtc.lib 文件。然后我试图设置 Visual Studio 2017 简单项目以使用 webrtc,我指出包含和库目录以及在依赖项中添加了 webrtc.lib。出于某种原因,只是这样的简单代码:

#define WEBRTC_WIN

#include<iostream>
#include<api/mediastreaminterface.h>

int main(int argc, char** argv)
{
    return 0;
}

产生大约 100 个错误,主要是关于 min 和 max 函数以及 rtc::rtc 命名空间,这很奇怪,看起来好像所有 rtc::x 调用它都会解释为 rtc::rtc:x 例如

Error   C2039   'scoped_refptr': is not a member of 'rtc::rtc'  webrtctest  c:\libwebrtc\webrtc\src\api\mediastreaminterface.h  287 

我尝试下载具有不同包含文件的已编译版本,但出现相同的错误。还有一个错误说

Error   C2059   syntax error: 'namespace'   webrtctest  c:\libwebrtc\webrtc\src\rtc_base\messagequeue.h 33  

这是指向这一行的:

namespace rtc {

我已经下载了最新的branch-69,我的windows sdk版本是10.0.17134.0

【问题讨论】:

    标签: c++ visual-studio build webrtc


    【解决方案1】:

    我已经成功了。我必须在所有内容之上添加#define NOMINMAX,因为 windows.h 中有同名的宏。

    【讨论】:

      猜你喜欢
      • 2017-10-27
      • 2016-01-11
      • 2021-04-16
      • 1970-01-01
      • 2022-01-24
      • 2015-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多