microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.13k stars 6.16k forks source link

[pcl] compile error “vtkSmartPointer.h”: No such file or directory #24439

Open unnamed2 opened 2 years ago

unnamed2 commented 2 years ago

Describe the bug

#include <pcl/visualization/cloud_viewer.h>

got fatal error C1083: “vtkSmartPointer.h”: No such file or directory

Environment

To Reproduce Steps to reproduce the behavior:

  1. ./vcpkg install pcl[vtk]:x64-windows
  2. #include <pcl/visualization/cloud_viewer.h>
  3. compile error

Expected behavior build success

Failure logs A:\vcpkg\installed\x64-windows\include\pcl\visualization\point_cloud_geometry_handlers.h(49,10): fatal error C1083: 无法打开包括文件: “vtkSmartPointer.h”: No such file or directory

Additional context

vcpkg list
pcl:x64-windows                                    1.12.0#6         Point Cloud Library (PCL) is open source library...
pcl[visualization]:x64-windows                                      Build visualization
pcl[vtk]:x64-windows                                                An alias for visualization
vtk:x64-windows                                    9.0.3-pv5.9.1#10 Software system for 3D computer graphics, image ...

vtkSmartPointer.h can be included by

#include <vtk-9.0/vtkSmartPointer.h>

code in pcl(point_cloud_geometry_handlers.h):

#include <vtkSmartPointer.h>
#include <vtkPoints.h>
#include <vtkFloatArray.h>
Cheney-W commented 2 years ago

About your repro step 2 and 3, did you do them in a cmake project or a visual studio empty project? Could you please provide me with your repro project?

unnamed2 commented 2 years ago

@Cheney-W visual studio empty project,Creating a new console application and then replacing the contents of the generated cpp with the following line of code generates such an error.

#include <pcl/visualization/cloud_viewer.h>

I just tried the cmake project and found that the cmake project did not have such a problem.

unnamed2 commented 2 years ago

Here's the project I created

Cheney-W commented 2 years ago

Thanks for your reply! I could reproduce this issue in my side.

Linhuihang commented 2 years ago

same question i have

mcelhennyi commented 1 year ago

This happened to me as well. 1.12.1 build. Ubuntu 18.04

best-pureer commented 1 year ago

没办法,pcl内部的vtk include path和vcpkg的include格式不适配,只能手动添加vtk的include path和lib path

LOUYIJITUAN commented 1 year ago

解决方案("VS属性设置-通用属性-VC++目录-包含目录") 添加路径 *\3rdParty\VTK\include\vtk-9.1

之前配置页信息可能为:

D:\PCL 1.12.1\include\pcl-1.12 D:\PCL 1.12.1\3rdParty\Boost\include\boost-1_78 D:\PCL 1.12.1\3rdParty\Eigen\eigen3 D:\PCL 1.12.1\3rdParty\FLANN\include D:\PCL 1.12.1\3rdParty\Qhull\include D:\PCL 1.12.1\3rdParty\OpenNI2\Include D:\PCL 1.12.1\3rdParty\VTK\include

修改后的配置页信息

D:\PCL 1.12.1\include\pcl-1.12 D:\PCL 1.12.1\3rdParty\Boost\include\boost-1_78 D:\PCL 1.12.1\3rdParty\Eigen\eigen3 D:\PCL 1.12.1\3rdParty\FLANN\include D:\PCL 1.12.1\3rdParty\Qhull\include D:\PCL 1.12.1\3rdParty\OpenNI2\Include D:\PCL 1.12.1\3rdParty\VTK\include D:\PCL 1.12.1\3rdParty\VTK\include\vtk-9.1

jimwang118 commented 1 year ago

I tested the latest version of vcpkg, and this problem should be solved, and the compilation result is normal by referring to the header file #include <pcl/visualization/cloud_viewer.h>.

bisalgt commented 1 year ago

I am not able to solve this issue in mac m1. Please let me know if any solutions

ZhangYazhengCN commented 8 months ago

The version of vcpkg is newest, but still have the same question. Waiting for a solution which needn't import the lib path in the project's property pages.

notes: windows10, VS2019, manifest mode

njk42 commented 6 months ago

Same problem for me. Win 10, manifest mode, VS2022, MSBuild project.

The relevant part of my vcpkg.json is:

{
  "name": "pcl",
  "default-features": true,
  "features": ["visualization", "vtk"]
}

The issue appears to be that vcpkg installs the missing header in "../vcpkg_installed///include/vtk-9.2" rather than ""../vcpkg_installed///include/" which is the include directory that MSVC is searching.

github-actions[bot] commented 4 weeks ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Olli1080 commented 3 weeks ago

This issue does still exist for vtk. I have similar issues with with librsvg, glib, gdk-pixbuf and cairo.

Workarounds which work for me:

$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\vtk-9.3;
$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\librsvg-2.0;
$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\glib-2.0;$(VcpkgInstalledDir)\$(VcpkgTriplet)\lib\glib-2.0\include;
$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\gdk-pixbuf-2.0;
$(VcpkgInstalledDir)\$(VcpkgTriplet)\include\cairo;

This was tested on the master branch today (03.06.2024).