添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

vs2022 + Open3d win10配置

4 个月前 · 来自专栏 研究生

讲真,如果不是一定要c++版本的Open3d,可以选择使用python版本的open3d或者c++版本的pcl库。


本教程需要提前安装好git vs2022 python cmake,并假设对vs配置c++有一定的了解。

1. 源码编译或直接下载

需要源码编译的可以参考这个Blog

也可以直接下载

编译好的或者下载的文件如下:

2. vs设置

这里的设置为Release版本

属性管理器 --> Release|x64 打开属性设置

2.1设置包含目录:

设置include和\include\open3d\3rdparty两个文件夹

2.2 库目录设置

库目录设置为lib文件夹

2.3 预处理器设置

添加 CURL_STATICLIB

2.4代码生成模式

这个我是根据报错设置为了MT模式,有的教程写的不是该模式, 请根据报错修改

2.5 附加依赖项添加

Open3D.lib
opengl32.lib
Open3D_3rdparty_assimp.lib
Open3D_3rdparty_blas_mkl_core.lib
Open3D_3rdparty_blas_mkl_intel_ilp64.lib
Open3D_3rdparty_blas_mkl_sequential.lib
Open3D_3rdparty_blas_mkl_tbb_thread.lib
Open3D_3rdparty_blas_tbb_static.lib
Open3D_3rdparty_civetweb_civetweb-cpp.lib
Open3D_3rdparty_civetweb_civetweb.lib
Open3D_3rdparty_curl.lib
Open3D_3rdparty_embree_embree3.lib
Open3D_3rdparty_embree_embree_avx.lib
Open3D_3rdparty_embree_embree_avx2.lib
Open3D_3rdparty_embree_lexers.lib
Open3D_3rdparty_embree_math.lib
Open3D_3rdparty_embree_simd.lib
Open3D_3rdparty_embree_sys.lib
Open3D_3rdparty_embree_tasking.lib
Open3D_3rdparty_filament_backend.lib
Open3D_3rdparty_filament_bluegl.lib
Open3D_3rdparty_filament_bluevk.lib
Open3D_3rdparty_filament_filabridge.lib
Open3D_3rdparty_filament_filaflat.lib
Open3D_3rdparty_filament_filamat_lite.lib
Open3D_3rdparty_filament_filament.lib
Open3D_3rdparty_filament_filameshio.lib
Open3D_3rdparty_filament_geometry.lib
Open3D_3rdparty_filament_ibl.lib
Open3D_3rdparty_filament_image.lib
Open3D_3rdparty_filament_meshoptimizer.lib
Open3D_3rdparty_filament_smol-v.lib
Open3D_3rdparty_filament_utils.lib
Open3D_3rdparty_fmt.lib
Open3D_3rdparty_glew.lib
Open3D_3rdparty_glfw.lib
Open3D_3rdparty_imgui.lib
Open3D_3rdparty_ippicv_ippicvmt.lib
Open3D_3rdparty_ippicv_ippiw.lib
Open3D_3rdparty_jpeg.lib
Open3D_3rdparty_jsoncpp.lib
Open3D_3rdparty_liblzf.lib
Open3D_3rdparty_png.lib
Open3D_3rdparty_qhullcpp.lib
Open3D_3rdparty_qhull_r.lib
Open3D_3rdparty_rply.lib
Open3D_3rdparty_tbb_tbbmalloc_static.lib
Open3D_3rdparty_tbb_tbb_static.lib
Open3D_3rdparty_tinyfiledialogs.lib
Open3D_3rdparty_uvatlas.lib
Open3D_3rdparty_vtk_vtkCommonCore-9.1.lib
Open3D_3rdparty_vtk_vtkCommonDataModel-9.1.lib
Open3D_3rdparty_vtk_vtkCommonExecutionModel-9.1.lib
Open3D_3rdparty_vtk_vtkCommonMath-9.1.lib
Open3D_3rdparty_vtk_vtkCommonMisc-9.1.lib
Open3D_3rdparty_vtk_vtkCommonSystem-9.1.lib
Open3D_3rdparty_vtk_vtkCommonTransforms-9.1.lib
Open3D_3rdparty_vtk_vtkFiltersCore-9.1.lib
Open3D_3rdparty_vtk_vtkFiltersGeneral-9.1.lib
Open3D_3rdparty_vtk_vtkFiltersModeling-9.1.lib
Open3D_3rdparty_vtk_vtkFiltersSources-9.1.lib
Open3D_3rdparty_vtk_vtkkissfft-9.1.lib
Open3D_3rdparty_vtk_vtkpugixml-9.1.lib
Open3D_3rdparty_vtk_vtksys-9.1.lib
Open3D_3rdparty_webrtc_webrtc.lib
Open3D_3rdparty_webrtc_webrtc_extra.lib
Open3D_3rdparty_zeromq.lib
Open3D_3rdparty_zlib.lib

还可以通过python读取lib文件夹下所有的lib库,代码如下:

import glob
import os.path
for file in glob.glob(os.path.join(r"lib目录", "*.lib")):
    print(file.split("\\")[-1])

上面会输出一连串lib库,然后额外添加一个 opengl32.lib。

3试运行

到此,设置结束,可以运行下面的代码测试

#include <string>
#include "Open3D/Open3D.h"
int main(int argc, char* argv[]) {
    if (argc == 2) {
        std::string option(argv[1]);
        if (option == "--skip-for-unit-test") {
            open3d::utility::LogInfo("Skiped for unit test.");
            return 0;