问题
My environment is below.
・Operating System and version:windows 10 64bit
・Compiler:C:\msys64\mingw64\bin\g++.exe
・PCL Version:1.9.1
pcl_config.h not found as below error occurred when compiled under above env..
Certainly this header file is not included.
Let me know how to solve it.
PS C:\pcl\pcl\examples\common> g++ -o minmax -I ../../io/include -I ../../common/include .\example_get_max_min_coordinates.cpp
In file included from ../../common/include/pcl/PCLHeader.h:10,
from ../../common/include/pcl/point_cloud.h:47,
from ../../io/include/pcl/io/pcd_io.h:42,
from .\example_get_max_min_coordinates.cpp:2:
../../common/include/pcl/pcl_macros.h:64:10: fatal error:
pcl/pcl_config.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
回答1:
Short answer
pcl_config.h
is generated via pcl_config.h.in
by the cmake tool. So it seems that compilation did not finish correctly.
Longer answer
- Please make sure you have compiled the relevant modules of PCL (at least pcl-core) before proceeding
- You might prefer a pre-built installation from releases or distributed by a package/source manager of your choice
- PCL makes heavy use of other libraries and it is best to supply the dependencies (as mentioned below) via CMake or manually via the
-I
and-l
options. If you provide the location ofpcl_config.h
, the compiler will complain aboutEigen
next.
The build instructions are available here. TL;DR: After satisfying the dependencies (cmake, c++ compiler, boost, eigen, flann, vtk and other depending on use-case), run the following commands
cd $PCL_SOURCE_DIR
mkdir -p build; cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
Feel free to use any build generator (like Ninja) or change build type to Debug
or RelWithDebInfo
as per your needs.
来源:https://stackoverflow.com/questions/56633207/pcl-pcl-config-h-no-such-file-or-directory