webrtc源码编译+vs2017+生成sln

原文链接:http://www.cnblogs.com/zhanghaibing/p/9848609.html

前提:不涉及跳 - 墙

因最新的工程配置文件(2018.10.25)vs_toolchain.py只支持vs2017(_CopyPGORuntime),需要下载vs2017

 

否则在执行 gclient sync 命令时,会报“Unexpected toolchain version .....”错误

 

一:安装 depot_tools
  (1) 安装 WebRTC 代码下载工具 depot_tools(Google),参考页面:地址

    $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

    或者直接下载解压:地址

  (2) 设置环境变量

    

 

二:下载安装 Windows SDK 10

  不安装在后面生时会报缺少dbghelp.dll

SDK地址

安装时只需选择windbg即可,无需全部安装

 

三:设置默认编译工具 IDE 版本,设置环境变量,用于生成 VS 工程文件

 

四:下载 WebRTC 源码

  (1)在准备放置代码的目录下,启动cmd窗口

    gclient config https://chromium.googlesource.com/external/webrtc --name=src

          这里“src”是我的代码目录名字

  (2)同步最新的代码

    gclient sync

    这里如果出现各种py错误,多半是环境变量设置的问题

五:编译 

  WebRTC 目前使用 GN 来生成构建脚本,Ninja 进行构建,所以系统平台均是。

  所以网上说的通过 GYP 生成 VS 解决方案工程文件的博文都已失效,用的均为旧版本的 webrtc。

  (1)生成 Ninja 工程文件

    Ninja 工程文件由 GN 生成,为其选择一个放置的目录中,如 out/Debug 或者 out/Release,这里官方建议选择 out/Default 这样可以放置 debug 和 release,在 src 目录下还行一下命令:

      gn gen out/Default

    如果需要生成 release 工程文件,需在后面加上关闭 Default的参数 --args='is_debug= false'
    生成 VS 解决方案工程文件
      gn gen --ide=vs out/Default
    会在 out/Default 目录下生成 all.sln 解决方案文件

转载于:https://www.cnblogs.com/zhanghaibing/p/9848609.html

展开阅读全文
博主设置当前文章不允许评论。

vs2017生成dll的问题

05-08

我有一个头文件init_data.h用于声明全局变量和一些类如下:rn[code=c]#pragma oncern#ifndef init_data_Hrn#define init_data_Hrn#includern#includern#includern#includern#include rn#include rn#include rn#include rn#include rn#include rnrntypedef pcl::PointXYZ PointT;rntypedef pcl::PointCloud PointCloudT;rntypedef struct txtPoint_XYZRGB rn double x;rn double y;rn double z;rn double r;rn double g;rn double b;rntxtPoint_XYZRGB;rntypedef struct txtPoint_XYZ rn double x;rn double y;rn double z;rntxtPoint_XYZ;rn//键盘鼠标事件实例化rnclass enent :public osgGA::GUIEventHandlerrnrnpublic:rn enent() ;rn ~enent() ;rn virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us);rnprotected:rnprivate:rn osg::ref_ptr node_;rn;rnrnclass VisitorNode : public osg::NodeVisitorrnrnpublic:rn VisitorNode() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0) ;rn osg::Vec3f getFirst();rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn osg::Vec3f AAA;rn;rnrn//遍历标绘点rnclass DelVisitorNode : public osg::NodeVisitorrnrnpublic:rn DelVisitorNode(int x, int y) : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0) rn XX = x;rn YY = y;rn ;rn osg::Vec3f dgetFirst();rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn osg::Vec3f AAA;rn int XX;rn int YY;rn;rnrn//截取恢复遍历rnclass RestoreVisitorNode : public osg::NodeVisitorrnrnpublic:rn RestoreVisitorNode() :osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0) ;rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn;rnrn//三维转2D遍历,去掉上顶板rnclass ScreenShotVisitorNodeup : public osg::NodeVisitorrnrnpublic:rn ScreenShotVisitorNodeup() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0)rn ;rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn osg::Vec3f AAA;rn int XX;rn int YY;rn int ZZ;rn;rnrn//三维转2D遍历rnclass ScreenShotVisitorNodedown : public osg::NodeVisitorrnrnpublic:rn ScreenShotVisitorNodedown() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0)rn rn ;rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn osg::Vec3f AAA;rn int XX;rn int YY;rn int ZZ;rn;rnrn//遍历更改点云颜色rnclass sketchVisitorNode : public osg::NodeVisitorrnrnpublic:rn sketchVisitorNode() :osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0)rn ;rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn;rnrn//三维转2D遍历rnclass ScreenShotBVisitorNode : public osg::NodeVisitorrnrnpublic:rn ScreenShotBVisitorNode() : osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), _indent(0)rn ;rn void apply(osg::Geode &node);rnprivate:rn int _indent;rn osg::Vec3f AAA;rn int XX;rn int YY;rn int ZZ;rn;rnrn#endifrnrn#ifdef init_data_EXPORTSrn#define init_data __declspec(dllexport)rn#elsern#define init_data __declspec(dllimport)rn#endifrnrnrnrnextern "C" txtPoint_XYZRGB txtPoint;rnextern "C" std::vector txtPoints;rnrnextern "C" osg::ref_ptr viewer;rnextern "C" osg::ref_ptr camera;rnrnextern "C" float sketchS;rnextern "C" float sketchR;rnextern "C" float sketchG;rnextern "C" float sketchB;rnextern "C" float sketchA;rnextern "C" int sketh_num;//标绘点数rnrnextern "C" float dataR;rnextern "C" float dataG;rnextern "C" float dataB;rnextern "C" float dataA;rnrnextern "C" int VisitorNode_X;rnextern "C" int VisitorNode_Y;rnextern "C" int flag2;rnextern "C" std::string DistoricalData_path;rnextern "C" int GEODE_points_num;rnextern "C" int COL_I;//文件列数rnextern "C" long int sizeofnow_N;rnextern "C" TCHAR chpath[MAX_PATH];rnextern "C" int flag_filter;//加载完数据才能滤波,值大于0rnextern "C" float max_rgb;rnextern "C" float POINT_X_min;rnextern "C" float POINT_X_max;rnextern "C" float POINT_Y_min;rnextern "C" float POINT_Y_max;rnextern "C" float POINT_Z_min;rnextern "C" float POINT_Z_max;rnextern "C" int DN;//采样率rnextern "C" long int sizeofnow;//读取进度rnextern "C" float ReadProgress;rnextern "C" long int sizeoffile;rnextern "C" float AY, BY, CenterY, MidDeltY;rnextern "C" float MT[3];rnextern "C" float YY_up, YY_down;[/code]rninit_data定义全局变量和一些类方法如下:rn[img=https://img-bbs.csdn.net/upload/201905/08/1557322891_510478.png][/img]rnrn有很多cpp调用这个头文件,然后我想能让c#调用这个dll,所以用了clr模式rnrn[img=https://img-bbs.csdn.net/upload/201905/08/1557322959_62747.png][/img]rnrn然后出现如下错误rnrn1>Axis_clear.cpprn1>c:\pcl 1.8.1\3rdparty\boost\include\boost-1_64\boost\filesystem\path.hpp(579): error C2059: 语法错误:“generic”rn1>c:\pcl 1.8.1\3rdparty\boost\include\boost-1_64\boost\filesystem\path.hpp(579): error C2334: “”的前面有意外标记;跳过明显的函数体rnrn在无公共语言支持下是没有错误的,怎么解决,难道我用错了吗rnrn 论坛

没有更多推荐了,返回首页