pcl
pcl copied to clipboard
[pcl::PCDReader::read] Could not find file .
My code is as follows:
typedef pcl::PointCloudpcl::PointXYZ pointcloud;
pointcloud::Ptr source(new pointcloud);
pointcloud::Ptr target(new pointcloud);
if (pcl::io::loadPCDFilepcl::PointXYZ("1.pcd", *source) == -1) {
PCL_ERROR("Couldn't read file 1.pcd \n");
return -1;
}
pcl::io::loadPCDFilepcl::PointXYZ("1.pcd", *source);
pcl::io::loadPCDFilepcl::PointXYZ("2.pcd", *target);
It compiles, but the following error occurs when reading the PCD file:
I tried to change to an absolute path, but I still couldn't read the PCD file. Can you tell me why?
- OS: [Windows11]
- Compiler: [:Visual Studio 2022]
- PCL Version [1.14.1]
My best guess would be that you mix debug and release libraries. How do you build your code? Do you use CMake? Also, please post the output and error message as text, not as a screenshot. At least then I can put it into a translator, to get the message in English.
Thank you for your reply. I didn't use CMake, I just wrote the code and compiled it directly through Visual Studio 2022. Here is some information for your reference: “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtksys-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkChartsCore-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingLOD-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkViewsContext2D-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingContextOpenGL2-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkInteractionWidgets-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkFiltersModeling-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkInteractionStyle-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkFiltersExtraction-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingAnnotation-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingContext2D-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingFreeType-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingOpenGL2-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkImagingSources-9.3.dll”。模块已生成,不包含符号。 “point_cloud_registration.exe”(Win32): 已加载“D:\PCL1.14.1\3rdParty\VTK\bin\vtkRenderingCore-9.3.dll”。模块已生成,不包含符号。 16:35:13:015 “point_cloud_registration.exe”(Win32): 已加载“C:\Windows\System32\imm32.dll”。 16:35:13:015 线程 35068 已退出,返回值为 0 (0x0)。 16:35:13:015 “point_cloud_registration.exe”(Win32): 已加载“C:\Windows\System32\kernel.appcore.dll”。 16:35:13:015 线程 33172 已退出,返回值为 4294967295 (0xffffffff)。 16:35:13:015 线程 7656 已退出,返回值为 4294967295 (0xffffffff)。 16:35:13:015 程序“[35420] point_cloud_registration.exe”已退出,返回值为 4294967295 (0xffffffff)。
[pcl::PCDReader::read] Could not find file '`笓'. Couldn't read file 1.pcd
C:\Users\WANGBO\Desktop\point_cloud_registration\x64\Debug\point_cloud_registration.exe (进程 35420)已退出,代码为 -1 (0xffffffff)。 要在调试停止时自动关闭控制台,请启用“工具”->“选项”->“调试”->“调试停止时自动关闭控制台”。 按任意键关闭此窗口. . .
So it seems like you are building your code in debug configuration. Did you check whether the libraries you link (especially the PCL libraries) are the debug version, not the release version? I would strongly recommend to use CMake because it takes care of these things.
So it seems like you are building your code in debug configuration. Did you check whether the libraries you link (especially the PCL libraries) are the debug version, not the release version? I would strongly recommend to use CMake because it takes care of these things.
Sorry, I'm not familiar with VS yet, can you tell me how to set it to debug or realease version?
https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-set-debug-and-release-configurations?view=vs-2022 This explains how to set the build configuration of your code.
@BoBoINVICTUS Did that help? Can this issue be closed?
Closing due to no response. I am going to assume then that switching the build configuration solved the problem.