0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PCLのインストール

Posted at

Point Cloud Libraryのインストールで挫折する人はかなり多いと思いますので少しでも力になれたら幸いです。

実行環境

・Visual Studio2022
・CMake GUI 3.31.6

All-in-One Installerのインストール

vcpkgでインストールすることも試みましたが、うまくいかなかったのでAll-in-One Installerでインストールすることにしました。
以下のリンクよりバージョン1.13.1(最新のバージョンは1.15.1ですが実行できません)

ダウウンロードしたらインストールを実行してください。展開先は推奨されるProgram File内で構いません。

環境変数の設定

システムの環境変数に以下の環境変数を追加してください。念のため追加した後、PCの再起動を行ってください。

環境変数名 パス
Path C:\Program Files\OpenNI2
C:\Program Files\PCL 1.13.1\bin
C:\Program Files\PCL 1.13.1\3rdParty
C:\Program Files\PCL 1.13.1\3rdParty\VTK\bin
C:\Program Files\OpenNI2\Tools
PCL_ROOT C:\Program Files\PCL 1.13.1
OPENNI2_INCLUDE64 C:\Program Files\OpenNI2\Include\
OPENNI2_LIB64 C:\Program Files\OpenNI2\Lib\
OPENNI2_REDIST64 C:\Program Files\OpenNI2\Redist\

ここを正しく設定しないことでよくエラーが起こります。

CMakeの実行(したい人は)

以下のCMakeLists.txt作成し保存することで完了です。

.cmake
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

project(プロジェクト名)

find_package(PCL REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable (プロジェクト名 cloud_viewer.cpp)
target_link_libraries (プロジェクト名 ${PCL_LIBRARIES})

お疲れ様でしたー

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?