Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pcl::PCDReader::read] Could not find file . #6132

Open
BoBoINVICTUS opened this issue Sep 12, 2024 · 6 comments
Open

[pcl::PCDReader::read] Could not find file . #6132

BoBoINVICTUS opened this issue Sep 12, 2024 · 6 comments
Labels

Comments

@BoBoINVICTUS
Copy link

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:
image
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]
@BoBoINVICTUS BoBoINVICTUS added kind: bug Type of issue status: triage Labels incomplete labels Sep 12, 2024
@mvieth
Copy link
Member

mvieth commented Sep 12, 2024

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.

@mvieth mvieth added module: io and removed status: triage Labels incomplete labels Sep 12, 2024
@BoBoINVICTUS
Copy link
Author

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)。
要在调试停止时自动关闭控制台,请启用“工具”->“选项”->“调试”->“调试停止时自动关闭控制台”。
按任意键关闭此窗口. . .

@mvieth
Copy link
Member

mvieth commented Sep 13, 2024

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.

@BoBoINVICTUS
Copy link
Author

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?

@mvieth
Copy link
Member

mvieth commented Sep 16, 2024

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.

@mvieth
Copy link
Member

mvieth commented Oct 17, 2024

@BoBoINVICTUS Did that help? Can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants