028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

手把手教你在windows下源码编译Open3D-创新互联

编译环境编译步骤
mkdir build
cd build

cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="" ..

填写你的VS版本,例如我是vs2022(17),open3d_install_directory使用当前路径".",最终我的命令为:

10年积累的网站设计、成都做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先网站设计后付款的网站建设流程,更有皇姑免费网站建设让你可以放心的选择与我们合作。
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="." ..
cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target INSTALL
编译中的bug 下载超时问题,ispc、pybind11、open3d_sphinx_theme等

报错信息类似:

error : downloading 'https://github.com/xxx/'
boringssl

这个库的下载路径不存在,所以我们需要去GitHub下载boringssl-master.zip

DirectXMath、DirectXHeaders
fatal: unable to access 'https://github.com/microsoft/DirectXMath.git/': Failed to connect to github.com port 443 aft
  er 21085 ms: Timed out

博主的 curl 下载并编译好后,会自动下载装好。上述方法不行试试,github下载了DirectX-Headers-mains和DirectXMath-main,并解压到build\uvatlas\src\ext_directxheaders和build\uvatlas\src\ext_directxmath

验证编译是否成功

随便打开build\bin\examples\Release\下的例程,例如:Draw.exe
在这里插入图片描述

新建项目中使用

PS:3d库都是缝合怪

新建一个C++项目

插入如下代码:

#include#include "open3d/Open3D.h"

using namespace open3d;

int main(){// 从github上下载pcd文件,也可以自己找一个pcd文件
    auto demo_crop_data = data::DemoCropPointCloud();
    auto cloud_ptr = std::make_shared();
    if (io::ReadPointCloud(demo_crop_data.GetPointCloudPath(),*cloud_ptr)) {utility::LogInfo("Successfully read {}",demo_crop_data.GetPointCloudPath());
    } else {utility::LogWarning("Failed to read {}",demo_crop_data.GetPointCloudPath());
        return 1;
    }
    cloud_ptr->NormalizeNormals();
    visualization::DrawGeometries({cloud_ptr },"PointCloud",1600,900);
}

在这里插入图片描述

静态库整合

由于上面链接的静态库太多,故使用visual studio工具lib.exe(官方文档)进行合并,简化调用流程。由于lib.exe的合并的函数限制,把上面的的静态链接库按照体积分两份。

在这里插入图片描述

Lib.exe简单使用

输入cmd命令lib.exe /out:xmv1.lib Open3D.lib assimp-vc143-mt.lib 等

可以用python处理之前的链接路径,最后得到所有链接路径(绝对路径)。还没看懂的可以去看看这篇博客。

最后多个静态链接合并成xmv1.lib和xmv.lib

简化后的调用流程

你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧


网站名称:手把手教你在windows下源码编译Open3D-创新互联
链接地址:http://www.tsicrk.com/article/echgd.html

其他资讯

让你的专属顾问为你服务

1.7469s