Как правильно настроить библиотеку PCL с настройкой Visual Studio 2017? - PullRequest
1 голос
/ 08 ноября 2019

Я новичок в библиотеке PCL. В настоящее время выполняется настройка библиотеки PCL с помощью Visual Studio 2017.

Шаги, за которыми я следовал:

  1. Я использовал установщик по умолчанию All-in-one-installer, предоставленный на сайте - Windows MSVC 2010 (64-разрядная версия) .

  2. Я исправил некоторую ошибку в openni2 (проблема с пространством пути), поэтому я изменил переменную окружения и смог успешно установить ее.

  3. Теперь, когда я использую командный инструмент для тестирования программы просмотра PCL, она работает нормально.

Check here

Теперь я намерен использовать PCL в среде Visual Studio (особенно в 2017 году), для которой я установил следующее

a. Я правильно указал путь к включаемым свойствам проекта> C / C ++> Общие> Дополнительные каталоги включения

C:\Program Files\PCL 1.9.1\3rdParty\Boost\include\boost-1_68
C:\Program Files\PCL 1.9.1\3rdParty\FLANN\include
C:\Program Files\PCL 1.9.1\3rdParty\Qhull\include
C:\Program Files\PCL 1.9.1\3rdParty\VTK\include
C:\Program Files\PCL 1.9.1\3rdParty
C:\Program Files\OpenNI2\Include
C:\Program Files\PCL 1.9.1\include\pcl-1.9
C:\Program Files\PCL 1.9.1\3rdParty\Eigen\eigen3\Eigen\src
C:\Program Files\PCL 1.9.1\3rdParty\Eigen\eigen3
C:\Program Files\PCL 1.9.1\3rdParty\VTK\include\vtk-8.1

Обратите внимание, что не было Eigen \ Include, но был Eigen \ src

б. Затем я устанавливаю библиотеки: Project Properties> Linker> General> Дополнительные каталоги библиотек

C:\Program Files\PCL 1.9.1\3rdParty\Boost\lib
C:\Program Files\PCL 1.9.1\3rdParty\FLANN\lib
C:\Program Files\PCL 1.9.1\3rdParty\Qhull\lib
C:\Program Files\PCL 1.9.1\3rdParty\VTK\lib
C:\Program Files\PCL 1.9.1\lib
C:\Program Files\OpenNI2\Lib

cУстановите дополнительные зависимости, я установил следующее:

openNI2.lib
libboost_system-vc141-mt-x64-1_68.lib
libboost_filesystem-vc141-mt-x64-1_68.lib
libboost_thread-vc141-mt-x64-1_68.lib
libboost_date_time-vc141-mt-x64-1_68.lib
libboost_iostreams-vc141-mt-x64-1_68.lib
pcl_common_release.lib
pcl_features_release.lib
pcl_filters_release.lib
pcl_io_release.lib
pcl_io_ply_release.lib
pcl_kdtree_release.lib
pcl_keypoints_release.lib
pcl_octree_release.lib
pcl_registration_release.lib
pcl_sample_consensus_release.lib
pcl_search_release.lib
pcl_segmentation_release.lib
pcl_surface_release.lib
pcl_tracking_release.lib
pcl_visualization_release.lib
vtkRenderingAnnotation-8.1.lib
vtkRenderingContext2D-8.1.lib
vtkRenderingContextOpenGL-8.1.lib
vtkRenderingCore-8.1.lib
vtkRenderingFreeType-8.1.lib
vtkRenderingGL2PS-8.1.lib
vtkRenderingImage-8.1.lib
vtkRenderingLabel-8.1.lib
vtkRenderingLIC-8.1.lib
vtkRenderingLOD-8.1.lib
vtkRenderingOpenGL-8.1.lib
vtkRenderingVolume-8.1.lib
vtkRenderingVolumeOpenGL-8.1.lib
vtkalglib-8.1.lib
vtkChartsCore-8.1.lib
vtkCommonColor-8.1.lib
vtkCommonComputationalGeometry-8.1.lib
vtkCommonCore-8.1.lib
vtkCommonDataModel-8.1.lib
vtkCommonExecutionModel-8.1.lib
vtkCommonMath-8.1.lib
vtkCommonMisc-8.1.lib
vtkCommonSystem-8.1.lib
vtkCommonTransforms-8.1.lib
vtkDICOMParser-8.1.lib
vtkexoIIc-8.1.lib
vtkexpat-8.1.lib
vtkFiltersAMR-8.1.lib
vtkFiltersCore-8.1.lib
vtkFiltersExtraction-8.1.lib
vtkFiltersFlowPaths-8.1.lib
vtkFiltersGeneral-8.1.lib
vtkFiltersGeneric-8.1.lib
vtkFiltersGeometry-8.1.lib
vtkFiltersHybrid-8.1.lib
vtkFiltersHyperTree-8.1.lib
vtkFiltersImaging-8.1.lib
vtkFiltersModeling-8.1.lib
vtkFiltersParallel-8.1.lib
vtkFiltersParallelImaging-8.1.lib
vtkFiltersPoints-8.1.lib
vtkFiltersProgrammable-8.1.lib
vtkFiltersSelection-8.1.lib
vtkFiltersSMP-8.1.lib
vtkFiltersSources-8.1.lib
vtkFiltersStatistics-8.1.lib
vtkFiltersTexture-8.1.lib
vtkFiltersTopology-8.1.lib
vtkFiltersVerdict-8.1.lib
vtkfreetype-8.1.lib
vtkjpeg-8.1.lib
vtklibxml2-8.1.lib
vtkmetaio-8.1.lib
vtkNetCDF-8.1.lib
vtkpng-8.1.lib
vtkproj4-8.1.lib
vtksqlite-8.1.lib
vtksys-8.1.lib
vtktiff-8.1.lib
vtkverdict-8.1.lib
vtkhdf5-8.1.lib
OpenGL32.Lib

Теперь я хочу запустить тот же простой код визуализации PCD

#include <iostream>
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>

int user_data;

void viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
    viewer.setBackgroundColor(1.0, 0.5, 1.0);
    pcl::PointXYZ o;
    o.x = 1.0;
    o.y = 0;
    o.z = 0;
    viewer.addSphere(o, 0.25, "sphere", 0);
    std::cout << "i only run once" << std::endl;

}

void viewerPsycho(pcl::visualization::PCLVisualizer& viewer)
{
    static unsigned count = 0;
    std::stringstream ss;
    ss << "Once per viewer loop: " << count++;
    viewer.removeShape("text", 0);
    viewer.addText(ss.str(), 200, 300, "text", 0);

    //FIXME: possible race condition here:
    user_data++;
}

int main()
{
    pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBA>);
    pcl::io::loadPCDFile("C:\\DATASET\\k.pcd", *cloud);

    pcl::visualization::CloudViewer viewer("Cloud Viewer");

    //blocks until the cloud is actually rendered
    viewer.showCloud(cloud);

    //use the following functions to get access to the underlying more advanced/powerful
    //PCLVisualizer

    //This will only get called once
    viewer.runOnVisualizationThreadOnce(viewerOneOff);

    //This will get called once per visualization iteration
    viewer.runOnVisualizationThread(viewerPsycho);
    while (!viewer.wasStopped())
    {
        //you can also do cool processing here
        //FIXME: Note that this is running in a separate thread from viewerPsycho
        //and you should guard against race conditions yourself...
        user_data++;
    }
    return 0;
}

Результат:

Я не получаю никакой ошибки, компиляция прошла успешно. Когда я запускаю, он выдает VTKOutputwindow с

Generic warning: In c:\vtk-8.1.2\rendering\core\vtkpolydatamapper.cxx, line28
Error: no override for vtkPolyDataMapper 

и вылетает и говорит, что pcl_visualizer.hpp не найден

Qt VS Tools: QML debug: Debugging project 'Pcl'...
Qt VS Tools: QML debug: DISABLED: Non-Qt/MSBuild project
'Pcl.exe' (Win32): Loaded 'C:\Users\Thi\source\repos\Pcl\x64\Release\Pcl.exe'. Symbols loaded.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Program Files\PCL 1.9.1\bin\pcl_common_release.dll'. Module was built without symbols.
'Pcl.exe' (Win32): Loaded 'C:\Program Files\PCL 1.9.1\bin\pcl_io_release.dll'. Module was built without symbols.
'Pcl.exe' (Win32): Loaded 'C:\Program Files\PCL 1.9.1\bin\pcl_visualization_release.dll'. Module was built without symbols.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\wsock32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\vcpkg\installed\x64-windows\bin\OpenNI2.dll'. Symbols loaded.
'Pcl.exe' (Win32): Loaded 'C:\Program Files\PCL 1.9.1\bin\pcl_io_ply_release.dll'. Module was built without symbols.
'Pcl.exe' (Win32): Loaded 'C:\Program Files\PCL 1.9.1\bin\pcl_kdtree_release.dll'. Module was built without symbols.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\rlls64.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\oleacc.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\wininet.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\ntmarta.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\mswsock.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\wshqos.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\WSHTCPIP.DLL'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\wship6.dll'. Cannot find or open the PDB file.
Exception thrown at 0x00007FFAD2269129 in Pcl.exe: Microsoft C++ exception: Win32Util::Error at memory location 0x000000B308AFF770.
Exception thrown at 0x00007FFAD2269129 in Pcl.exe: Microsoft C++ exception: Win32Util::Error at memory location 0x000000B308AFF490.
Exception thrown at 0x00007FFAD2269129 in Pcl.exe: Microsoft C++ exception: Win32Util::Error at memory location 0x000000B308AFF490.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\schannel.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\crypt32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\msasn1.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\sspicli.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\TextInputFramework.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\CoreUIComponents.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
'Pcl.exe' (Win32): Unloaded 'C:\Windows\System32\WinTypes.dll'
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvaci.inf_amd64_7f41d5c2abbbcc03\nvoglv64.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\wtsapi32.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\wintrust.dll'. Cannot find or open the PDB file.
The thread 0x77c4 has exited with code 0 (0x0).
The thread 0x4848 has exited with code 0 (0x0).
The thread 0x2ab4 has exited with code 0 (0x0).
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\nvspcap64.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\System32\winsta.dll'. Cannot find or open the PDB file.
'Pcl.exe' (Win32): Loaded 'C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.17763.802_none_05b1445c0722d2cc\comctl32.dll'. Cannot find or open the PDB file.
Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkmapper.cxx, line 186
vtkMapper::ImmediateModeRenderingOff was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkmapper.cxx, line 233
vtkMapper::GetGlobalImmediateModeRendering was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkmapper.cxx, line 233
vtkMapper::GetGlobalImmediateModeRendering was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkrenderwindow.cxx, line 1480
vtkRenderWindow::GetPainterDeviceAdapter was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkrenderwindow.cxx, line 1480
vtkRenderWindow::GetPainterDeviceAdapter was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkmapper.cxx, line 233
vtkMapper::GetGlobalImmediateModeRendering was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkrenderwindow.cxx, line 1480
vtkRenderWindow::GetPainterDeviceAdapter was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkrenderwindow.cxx, line 1480
vtkRenderWindow::GetPainterDeviceAdapter was deprecated for VTK 8.1 and will be removed in a future version.

Generic Warning: In c:\vtk-8.1.2\rendering\core\vtkpolydatamapper.cxx, line 28
Error: no override found for 'vtkPolyDataMapper'.

Exception thrown at 0x00007FF61215AFF4 in Pcl.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

The program '[932] Pcl.exe' has exited with code 0 (0x0).

Я хотел бы знать, где именно проблема? Как правильно настроить библиотеку PCL в Visual Studio 2017?

1 Ответ

0 голосов
/ 13 ноября 2019

Установить последнюю версию pcl для VS-2017 https://github.com/PointCloudLibrary/pcl/releases

...