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

[compile error] voxel_grid_occlusion_estimation.cpp.obj : error LNK2001 "class vtkRenderWindowInteractor * __cdecl vtkRenderWindowInteractorFixNew(void)" #5923

Closed
zhangbin0917 opened this issue Jan 8, 2024 · 2 comments · Fixed by #5926

Comments

@zhangbin0917
Copy link

Describe the error

Please paste the compilation results/errors.

To Reproduce

cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=D:\Softwares\3rdLib\pcl-1.14.0\install -DCMAKE_CUDA_ARCHITECTURES=native -DBOOST_ROOT=D:\Softwares\3rdLib\boost_1_84_0-msvc-14.3-64 -DBoost_DIR=D:\Softwares\3rdLib\boost_1_84_0-msvc-14.3-64 -DBOOST_INCLUDEDIR=D:\Softwares\3rdLib\boost_1_84_0-msvc-14.3-64\boost -DEigen3_DIR=D:\Softwares\3rdLib\vcpkg\installed\x64-windows\share\eigen3 -DFLANN_ROOT=D:\Softwares\3rdLib\vcpkg\packages\flann_x64-windows -Dlz4_DIR=D:\Softwares\3rdLib\vcpkg\packages\lz4_x64-windows\share\lz4 -DQt5_DIR=D:\Softwares\3rdLib\QT\QT-5.15.2\msvc2019_64\lib\cmake\Qt5 -DVTK_DIR=D:\Softwares\3rdLib\VTK-9.3.0\install\lib\cmake\vtk-9.3
Screenshots/Code snippets/Build information

[1/1] Linking CXX executable bin\pcl_voxel_grid_occlusion_estimation.exe
FAILED: bin/pcl_voxel_grid_occlusion_estimation.exe
C:\windows\system32\cmd.exe /C "cd . && C:\Softwares\cmake\bin\cmake.exe -E vs_link_exe --intdir=tools\CMakeFiles\pcl_voxel_grid_occlusion_estimation.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\pcl_voxel_grid_occlusion_estimation.rsp  /out:bin\pcl_voxel_grid_occlusion_estimation.exe /implib:lib\pcl_voxel_grid_occlusion_estimation.lib /pdb:bin\pcl_voxel_grid_occlusion_estimation.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /LTCG /subsystem:console  && cd ."
LINK: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1438~1.331\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\pcl_voxel_grid_occlusion_estimation.rsp /out:bin\pcl_voxel_grid_occlusion_estimation.exe /implib:lib\pcl_voxel_grid_occlusion_estimation.lib /pdb:bin\pcl_voxel_grid_occlusion_estimation.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /LTCG /subsystem:console /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following output:
voxel_grid_occlusion_estimation.cpp.obj : error LNK2001: 无法解析的外部符号 "class vtkRenderWindowInteractor * __cdecl vtkRenderWindowInteractorFixNew(void)" (?vtkRenderWindowInteractorFixNew@@YAPEAVvtkRenderWindowInteractor@@XZ)
bin\pcl_voxel_grid_occlusion_estimation.exe : fatal error LNK1120: 1 个无法解析的外部命令
ninja: build stopped: subcommand failed.

Your Environment (please complete the following information):

  • OS: Windows 11
  • Compiler: vs2022
  • PCL Version 1.14
  • PCL Type: Compiled from source
@zhangbin0917 zhangbin0917 added kind: compile error Type of issue status: triage Labels incomplete labels Jan 8, 2024
@mvieth
Copy link
Member

mvieth commented Jan 9, 2024

Thanks for reporting. You can fix this with the following patch:

diff --git a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
index b427e76d9..7958f80e6 100644
--- a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
+++ b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
@@ -38,5 +38,6 @@
 #pragma once
 
 #include <vtkRenderWindowInteractor.h>
+#include <pcl/pcl_exports.h>
 
-vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();
+PCL_EXPORTS vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();

@mvieth mvieth added module: visualization and removed status: triage Labels incomplete labels Jan 9, 2024
@UnaNancyOwen
Copy link
Member

UnaNancyOwen commented Jan 10, 2024

Thanks for reporting. You can fix this with the following patch:

diff --git a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
index b427e76d9..7958f80e6 100644
--- a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
+++ b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
@@ -38,5 +38,6 @@
 #pragma once
 
 #include <vtkRenderWindowInteractor.h>
+#include <pcl/pcl_exports.h>
 
-vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();
+PCL_EXPORTS vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();

@mvieth I have confirmed that this issue is reproduced, and your patch will solve this error. Please sent pull-request. Thanks! 👍

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