一、配置前要先编程open3d
二、开始配置
新建txt
![](https://i-blog.csdnimg.cn/blog_migrate/5685f615f87e767a0b80ac8c31ff3daa.png)
把txt 修改为 pri
![](https://i-blog.csdnimg.cn/blog_migrate/da12a18e4a03ebc53a43fe65178a4eb7.png)
在pro 文件中添加 include(F:/xuwanlu/control.pri)
![](https://i-blog.csdnimg.cn/blog_migrate/6a255bf39dd1433cc8b23793dd24fb29.png)
重新构建项目然后回多出来pri
![](https://i-blog.csdnimg.cn/blog_migrate/b2844585bd9650eaf550c4eb6a46fa57.png)
在pri中添加open3d目录
INCLUDEPATH +=
F:\open3d\include\Open3D\3rdparty\GLFW\include \
F:\open3d\include\Open3D\3rdparty\glew\include \
F:\open3d\include\Open3D\3rdparty\fmt\include \
F:\open3d\include\Open3D\3rdparty\Eigen \
F:\open3d\include \
LIBS += F:\xuwanlu\open3d\lib\*.lib \
开始测试
void MainWindow::on_pushButton_13_clicked()
{
// -------------------------生成点云-----------------------------
auto noise_cloud = std::make_shared<open3d::geometry::PointCloud>();
int N = 10000;
noise_cloud->points_.resize(N);
std::normal_distribution<> norm{ 0, 0.002 };
std::random_device rd;
std::default_random_engine rng{ rd() };
for (size_t i = 0; i < N; ++i)
{
noise_cloud->points_[i][0] = norm(rng);
noise_cloud->points_[i][1] = norm(rng);
noise_cloud->points_[i][2] = norm(rng);
}
open3d::io::WritePointCloudToPCD("Gaiss_noise.pcd", *noise_cloud, false);
open3d::visualization::DrawGeometries({ noise_cloud }, "PointCloud", 1600, 900);
}
![](https://i-blog.csdnimg.cn/blog_migrate/b61e9ab864662ce8108dd82dc8aa7293.png)
报错
![](https://i-blog.csdnimg.cn/blog_migrate/7adebb915500aef515aac5cb2bf77a52.png)
解决找到 OpenGL32.Lib将lib 添加到 lib 的文件夹里面
发现还是报错
![](https://i-blog.csdnimg.cn/blog_migrate/e6c4388b5f662e24380938bbf169b1a1.png)
提示glf3w.lib
开始因为lib文件出问题、换了之后出现更多问题
![](https://i-blog.csdnimg.cn/blog_migrate/54279e98159ddd4eb3e55fa790fc842e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/825549a8a4955d79f6edf88c0a0e6cca.png)
没办法只能换回去
最后经过排查发现少了Gdi32.Lib
![](https://i-blog.csdnimg.cn/blog_migrate/23a5332b0e3f78f602e6956c5a472709.png)
快速通道:
链接:https://pan.baidu.com/s/1atMBX4JEEMoEvT46Sltk6g?pwd=ycbm
提取码:ycbm
--来自百度网盘超级会员V4的分享