Failed to build iMSTK with OpenVR

Hi, I am trying to build imstk with openvr support. However, the visual studio solution keeps generating an error in the iMSTK.sln while compiling:

cannot find "“vtkOpenVROverlayInternal.h”.

#ifdef iMSTK_ENABLE_VR
#include “vtkOpenVRRenderer.h”
#include “vtkOpenVRCamera.h”
#include “vtkOpenVRRenderWindow.h”
#include “vtkOpenVRRenderWindowInteractor.h”
#include “vtkInteractorStyle3D.h”
#include “vtkOpenVROverlayInternal.h”
#endif

There is no error in configuring the cmake file and everything works well.

Hi, can you specify the VS version and the version of windows you are building on? thank you

@sreekanth.arikatla
Sorry for replying late. I am still encountering this problem.
The cmake version 3.10.2, vs 15 2017 x64. windows SDK version 10.0.18362

Thanks. Will try to reproduce the problem and let you know.

I just tried with vs 2017 x64 with VR enabled and it worked fine.

imstk underwent buildsystem changes since Jan. Can you update your cmake to latest and try with the same vs version and build type?

@sreekanth.arikatla

I tried to build iMSTK with the latest CMake (version 3.17.2).
It turns out all dependency builds are passed except VTK build is failed with the Link errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol __imp__VR_ShutdownInternal referenced in function "class vr::IVRSystem * __cdecl vr::VR_Init(enum vr::EVRInitError *,enum vr::EVRApplicationType)" (?VR_Init@vr@@YAPAVIVRSystem@1@PAW4EVRInitError@1@W4EVRApplicationType@1@@Z) [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindow.obj	1	
Error	LNK2019	unresolved external symbol __imp__VR_IsInterfaceVersionValid referenced in function "class vr::IVRSystem * __cdecl vr::VR_Init(enum vr::EVRInitError *,enum vr::EVRApplicationType)" (?VR_Init@vr@@YAPAVIVRSystem@1@PAW4EVRInitError@1@W4EVRApplicationType@1@@Z) [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindow.obj	1	
Error	LNK2019	unresolved external symbol __imp__VR_InitInternal referenced in function "class vr::IVRSystem * __cdecl vr::VR_Init(enum vr::EVRInitError *,enum vr::EVRApplicationType)" (?VR_Init@vr@@YAPAVIVRSystem@1@PAW4EVRInitError@1@W4EVRApplicationType@1@@Z) [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindow.obj	1	
Error	LNK2019	unresolved external symbol __imp__VR_GetVRInitErrorAsEnglishDescription referenced in function "public: virtual void __thiscall vtkOpenVRRenderWindow::Initialize(void)" (?Initialize@vtkOpenVRRenderWindow@@UAEXXZ) [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindow.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetInitToken [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindowInteractor.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetInitToken [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRDefaultOverlay.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetInitToken [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRModel.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetInitToken [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVROverlay.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetInitToken [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindow.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetGenericInterface [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindowInteractor.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetGenericInterface [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRDefaultOverlay.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetGenericInterface [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRModel.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetGenericInterface [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVROverlay.obj	1	
Error	LNK2001	unresolved external symbol __imp__VR_GetGenericInterface [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\CMake\External\vtkOpenVRRenderWindow.obj	1	
Error	C1083	Cannot open include file: 'vtkOpenVRRenderer.h': No such file or directory (compiling source file D:\SimRepo\iMSTK\Source\Rendering\VTKRenderer\imstkVTKRenderer.cpp) [D:\SimRepo\iMSTK\build\Innerbuild\Source\Rendering\Rendering.vcxproj]	iMSTK (iMSTK\iMSTK)	d:\simrepo\imstk\source\rendering\vtkrenderer\imstkVTKRenderer.h	30	
Error	LNK1120	6 unresolved externals [D:\SimRepo\iMSTK\build\External\VTK\build\Rendering\OpenVR\vtkRenderingOpenVR.vcxproj]	VTK	D:\SimRepo\iMSTK\build\External\VTK\build\bin\Debug\vtkRenderingOpenVR-8.2d.dll	1	

Could you help me with this problem?
Thank you very much for your attention to this matter.