3

I want to complete this basic tutorial.

http://pointclouds.org/documentation/tutorials/writing_pcd.php#writing-pcd

Its very simple. When I prepare cmakelist and .cpp file, I run them with cmake gui and I get this error. I installed pcl 1.9.1 so I build file for visual studio 2017 64x.

Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.17763. The C compiler identification is MSVC 19.15.26726.0 The CXX compiler identification is MSVC 19.15.26726.0 Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works Detecting C compiler ABI info Detecting C compiler ABI info - done Detecting C compile features Detecting C compile features - done Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works Detecting CXX compiler ABI info Detecting CXX compiler ABI info - done Detecting CXX compile features Detecting CXX compile features - done CMake Warning (dev) at CMakeLists.txt:5 (find_package): Policy CMP0074 is not set: find_package uses _ROOT variables. Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Environment variable PCL_ROOT is set to:

C:\libraries\PCL 1.9.1

For compatibility, CMake is ignoring the variable. This warning is for project developers. Use -Wno-dev to suppress it.

Found Eigen: C:/libraries/PCL 1.9.1/3rdParty/Eigen/eigen3 Eigen found (include: C:/libraries/PCL 1.9.1/3rdParty/Eigen/eigen3, version: 3.3.5) Looking for pthread.h Looking for pthread.h - not found Found Threads: TRUE Found Boost: C:/libraries/PCL 1.9.1/3rdParty/Boost/include/boost-1_68 (found suitable version "1.68.0", minimum required is "1.40.0") found components: system filesystem thread date_time iostreams serialization chrono atomic regex Found FLANN: C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib FLANN found (include: C:/libraries/PCL 1.9.1/3rdParty/FLANN/include, lib: optimized;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s-gd.lib) FLANN found (include: C:/libraries/PCL 1.9.1/3rdParty/FLANN/include, lib: optimized;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s-gd.lib) Found OpenNI2: C:/libraries/OpenNI2/Lib/OpenNI2.lib OpenNI2 found (include: C:/libraries/OpenNI2/Include, lib: C:/libraries/OpenNI2/Lib/OpenNI2.lib) OpenNI2 found (include: C:/libraries/OpenNI2/Include, lib: C:/libraries/OpenNI2/Lib/OpenNI2.lib) Found Qhull: optimized;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic_d.lib QHULL found (include: C:/libraries/PCL 1.9.1/3rdParty/Qhull/include, lib: optimized;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic_d.lib) looking for PCL_COMMON Found PCL_COMMON: C:/libraries/PCL 1.9.1/lib/pcl_common_release.lib
looking for PCL_KDTREE Found PCL_KDTREE: C:/libraries/PCL 1.9.1/lib/pcl_kdtree_release.lib looking for PCL_OCTREE Found PCL_OCTREE: C:/libraries/PCL 1.9.1/lib/pcl_octree_release.lib
looking for PCL_SEARCH Found PCL_SEARCH: C:/libraries/PCL 1.9.1/lib/pcl_search_release.lib looking for PCL_SAMPLE_CONSENSUS Found PCL_SAMPLE_CONSENSUS: C:/libraries/PCL 1.9.1/lib/pcl_sample_consensus_release.lib looking for PCL_FILTERS Found PCL_FILTERS: C:/libraries/PCL 1.9.1/lib/pcl_filters_release.lib looking for PCL_2D Found PCL_2D: C:/libraries/PCL 1.9.1/include/pcl-1.9 looking for PCL_GEOMETRY Found PCL_GEOMETRY: C:/libraries/PCL 1.9.1/include/pcl-1.9 looking for PCL_IO Found PCL_IO: C:/libraries/PCL 1.9.1/lib/pcl_io_release.lib looking for PCL_FEATURES Found PCL_FEATURES: C:/libraries/PCL 1.9.1/lib/pcl_features_release.lib looking for PCL_ML Found PCL_ML: C:/libraries/PCL 1.9.1/lib/pcl_ml_release.lib looking for PCL_SEGMENTATION Found PCL_SEGMENTATION: C:/libraries/PCL 1.9.1/lib/pcl_segmentation_release.lib looking for PCL_VISUALIZATION Found PCL_VISUALIZATION: C:/libraries/PCL 1.9.1/lib/pcl_visualization_release.lib looking for PCL_SURFACE Found PCL_SURFACE: C:/libraries/PCL 1.9.1/lib/pcl_surface_release.lib looking for PCL_REGISTRATION Found PCL_REGISTRATION: C:/libraries/PCL 1.9.1/lib/pcl_registration_release.lib looking for PCL_KEYPOINTS Found PCL_KEYPOINTS: C:/libraries/PCL 1.9.1/lib/pcl_keypoints_release.lib looking for PCL_TRACKING Found PCL_TRACKING: C:/libraries/PCL 1.9.1/lib/pcl_tracking_release.lib
looking for PCL_RECOGNITION Found PCL_RECOGNITION: C:/libraries/PCL 1.9.1/lib/pcl_recognition_release.lib looking for PCL_STEREO Found PCL_STEREO: C:/libraries/PCL 1.9.1/lib/pcl_stereo_release.lib
looking for PCL_OUTOFCORE Found PCL_OUTOFCORE: C:/libraries/PCL 1.9.1/lib/pcl_outofcore_release.lib looking for PCL_PEOPLE Found PCL_PEOPLE: C:/libraries/PCL 1.9.1/lib/pcl_people_release.lib Found PCL: pcl_common;pcl_kdtree;pcl_octree;pcl_search;pcl_sample_consensus;pcl_filters;pcl_io;pcl_features;pcl_ml;pcl_segmentation;pcl_visualization;pcl_surface;pcl_registration;pcl_keypoints;pcl_tracking;pcl_recognition;pcl_stereo;pcl_outofcore;pcl_people;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_system-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_system-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_filesystem-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_filesystem-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_thread-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_thread-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_date_time-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_date_time-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_iostreams-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_iostreams-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_serialization-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_serialization-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_chrono-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_chrono-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_atomic-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_atomic-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_regex-vc141-mt-x64-1_68.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Boost/lib/libboost_regex-vc141-mt-gd-x64-1_68.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/Qhull/lib/qhullstatic_d.lib;C:/libraries/OpenNI2/Lib/OpenNI2.lib;optimized;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s.lib;debug;C:/libraries/PCL 1.9.1/3rdParty/FLANN/lib/flann_cpp_s-gd.lib;vtksys;vtkCommonCore;vtkCommonMath;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkCommonDataModel;vtkCommonColor;vtkCommonExecutionModel;vtkCommonComputationalGeometry;vtkFiltersCore;vtkFiltersGeneral;vtkImagingCore;vtkImagingFourier;vtkalglib;vtkFiltersStatistics;vtkFiltersExtraction;vtkInfovisCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingCore;vtkzlib;vtkfreetype;vtkRenderingFreeType;vtkRenderingContext2D;vtkChartsCore;vtkDICOMParser;vtklz4;vtkIOCore;vtkIOLegacy;vtkexpat;vtkIOXMLParser;vtkDomainsChemistry;vtkIOXML;vtkParallelCore;vtkFiltersAMR;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkImagingSources;vtkFiltersHybrid;vtkFiltersHyperTree;vtkImagingGeneral;vtkFiltersImaging;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelImaging;vtkFiltersPoints;vtkFiltersProgrammable;vtkFiltersSMP;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersTopology;verdict;vtkFiltersVerdict;vtkmetaio;vtkjpeg;vtkpng;vtktiff;vtkIOImage;vtkImagingHybrid;vtkInfovisLayout;vtkInteractionStyle;vtkImagingColor;vtkRenderingAnnotation;vtkRenderingVolume;vtkInteractionWidgets;vtkViewsCore;vtkproj4;vtkGeovisCore;vtkhdf5_hl;vtkhdf5;vtkIOAMR;vtkIOEnSight;vtkNetCDF;vtkexoIIc;vtkIOExodus;vtkRenderingOpenGL;vtkRenderingContextOpenGL;vtkgl2ps;vtkRenderingGL2PS;vtklibharu;vtkIOExport;vtkRenderingLabel;vtkIOExportOpenGL;vtkIOGeometry;vtkIOImport;vtklibxml2;vtkIOInfovis;vtkIOLSDyna;vtkIOMINC;vtkoggtheora;vtkIOMovie;vtknetcdfcpp;vtkIONetCDF;vtkIOPLY;vtkjsoncpp;vtkIOParallel;vtkIOParallelXML;vtksqlite;vtkIOSQL;vtkIOTecplotTable;vtkIOVideo;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkRenderingImage;vtkRenderingLIC;vtkRenderingLOD;vtkRenderingVolumeOpenGL;vtkViewsContext2D;vtkViewsInfovis (Required is at least version "1.2") Configuring done Generating done

After build, when I click open project and run it, I get this error.

enter image description here

Any solution for it?

drescherjm
  • 9,653
  • 5
  • 43
  • 62
  • When asking a question all relevant details MUST be in the question (links rot) and should be text (images are rendered unusable by [many things](https://meta.stackoverflow.com/a/285557/4581301)). – user4581301 Jun 13 '19 at 18:15
  • It's better / preferred if you copy and paste the text of the error message instead of a picture of your GUI. – drescherjm Jun 13 '19 at 18:16
  • The second error message is a user error. The `ALL_BUILD` target is not an executable target so you can't run or debug it. It's purpose to force all projects in the solution to build. Select a executable project as your startup project to fix that. – drescherjm Jun 13 '19 at 18:18
  • @user4581301 sorry I don't have enough points for posting picture –  Jun 13 '19 at 18:19
  • @drescherjm sorry I am very unexperienced about it. I didn't get what you mean –  Jun 13 '19 at 18:21
  • ***I didn't get what you mean*** Right click on a target / project in Visual Studio's Solution Explorer and set the "Set this project as the startup project" to fix the problem. You need to select a project that is an application not `ALL_BUILD` which is not an application. – drescherjm Jun 13 '19 at 18:23
  • The restrictions on posting pictures is partly because you do not want to post a picture. Avoid using images. Too many people cannot see them and they are much more difficult than text to search. – user4581301 Jun 13 '19 at 18:23
  • @user4581301 got it thanks, i will do like that –  Jun 13 '19 at 18:46
  • @drescherjm oh thank you for the answer, now it says " code can not be run, pcl_io_debug.dll can not be found. Reinstalling the program may solve the problem. " Do you know anything about this one? –  Jun 13 '19 at 18:50
  • I don't think there is any problem at al except trying to run the ALL_BUILD target. – drescherjm Jun 13 '19 at 18:50
  • ***Do you know anything about this one?*** You need to set the `PATH` environment variable to have an entry for the folder that contains the mentioned dll files it is asking for or just copy the dlls to the Debug folder where the executable exists. – drescherjm Jun 13 '19 at 18:52
  • @drescherjm PCL 1.9.1 path is already set in environment variable but i will try to put dll files in debug folder. thank you, you are awesome –  Jun 13 '19 at 18:58
  • @drescherjm I got an error " path is too long " while installing pcl. Maybe its about it but I added paths to environment variables by manually. Do you see any problem here? https://imgur.com/a/1P0yx9L –  Jun 13 '19 at 19:05
  • You may have to remove some other path in that list. Also you may want to push the bin folder higher. – drescherjm Jun 13 '19 at 19:06
  • This may help: https://stackoverflow.com/questions/34491244/environment-variable-is-too-large-on-windows-10 – drescherjm Jun 13 '19 at 19:08
  • I don't know which one should I remove, when I put all DLL 's to the debug folder, it worked. Thank you so much, I have spent 2 days while trying to install pcl or use Cmake. You are the only one that answers all my noob and newbie questions. I wish I could do something for you. –  Jun 13 '19 at 19:09
  • @drescherjm thank you for path link –  Jun 13 '19 at 19:10
  • This question is common for new users to `CMake` in `Visual Studio`. I have seen it a few times for different `CMake` based projects. – drescherjm Jun 13 '19 at 19:15
  • BTW, the `CMP0074` is not really a problem. It's a warning for the developer of the `CMakeLists.txt` that a behavior in `CMake` has changed. It's really not for the end user to worry so much about. – drescherjm Jun 13 '19 at 19:19
  • @drescherjm thank you, you are awesome –  Jun 13 '19 at 19:47
  • Please, do not format multiline error messages as a *blockquote*. This formatting doesn't preserve newlines, so the messages becomes hard to understand. Use **code** formatting instead (`Ctrl+K` or `{}` button). – Tsyvarev Jun 13 '19 at 20:21
  • @Tsyvarev okey i will do that, thank you for warning –  Jun 13 '19 at 20:55

1 Answers1

4

The CMP0074 warning is not really a problem you as a user need to worry about. It's a warning for the developer of the CMakeLists.txt that a behavior in CMake has changed.

https://cmake.org/cmake/help/latest/policy/CMP0074.html

In CMake 3.12 and above the find_package() command now searches prefixes specified by the _ROOT CMake variable and the ROOT environment variable. Package roots are maintained as a stack so nested calls to all find* commands inside find modules also search the roots as prefixes. This policy provides compatibility with projects that have not been updated to avoid using _ROOT variables for other purposes.

The OLD behavior for this policy is to ignore _ROOT variables. The NEW behavior for this policy is to use _ROOT variables.

Basically the warning is that the developers of the CMakeLists.txt have not set the policy to enable the new behavior or to keep the old behavior however the PCL_ROOT was defined. CMake will not automatically use it because the new behavior is not enabled.

The ALL_BUILD error message is because the ALL_BUILD target / project is not an executable target. It's purpose is to force building of all projects in the solution. To fix that part you need to right click on an executable project / target in the Solution Explorer and click "Set this project as the startup project"

drescherjm
  • 9,653
  • 5
  • 43
  • 62