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

Openvr failed to build with "error C2065 , error C2051"with MSVC on Windows #1686

Open
nnfdnkns opened this issue Sep 19, 2022 · 2 comments
Open

Comments

@nnfdnkns
Copy link

nnfdnkns commented Sep 19, 2022

Hi all,
Openvr failed to build with "error C2065 , error C2051"with MSVC on Windows. Could you please help look at this issue?

Environment:
Windows: windows server 2019
VS: 2019

Repro steps:
1.open VS2019 x64 tools command
2.git clone https://github.com/ValveSoftware/openvr F:\gitP\ValveSoftware\openvr\build_amd64
3.rename F:\gitP\ValveSoftware\openvr\src\vrcommon vrcore 2>&1
4.xcopy "F:\gitP\ami-iit\openvr\src\vrcommon\vrassert.h" "F:\gitP\ValveSoftware\openvr\src\vrcore" /k/r/e/i/s/c/h/f/y
5.cd F:\gitP\ValveSoftware\openvr\build_amd64
6.cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release .. 2>&1
7.msbuild /m /p:Platform=x64 /p:Configuration=Release OpenVRSDK.sln /t:Rebuild 2>&1

Error info:
F:\gitP\ValveSoftware\openvr\src\vrcore\hmderrors_public.cpp(183,3): error C2065: 'VRInitError_Init_CreateDriverDirectDeviceFailed': undeclared identifier [F:\gitP\ValveSoftware\openvr\build_amd64\src\openvr_api64.vcxproj]
F:\gitP\ValveSoftware\openvr\src\vrcore\hmderrors_public.cpp(183,3): error C2051: case expression not constant [F:\gitP\ValveSoftware\openvr\build_amd64\src\openvr_api64.vcxproj]

log
build.log

@sl1pkn07
Copy link

sl1pkn07 commented Nov 8, 2022

same here on linux

[ 66%] Building CXX object src/CMakeFiles/openvr_api.dir/vrcommon/hmderrors_public.cpp.o
/tmp/makepkg/openvr/src/openvr-1.23.7/src/vrcommon/hmderrors_public.cpp: In function 'const char* GetIDForVRInitError(vr::EVRInitError)':
/tmp/makepkg/openvr/src/openvr-1.23.7/src/vrcommon/hmderrors_public.cpp:183:40: error: 'VRInitError_Init_CreateDriverDirectDeviceFailed' was not declared in this scope
  183 |                 RETURN_ENUM_AS_STRING( VRInitError_Init_CreateDriverDirectDeviceFailed );
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/makepkg/openvr/src/openvr-1.23.7/src/vrcommon/hmderrors_public.cpp:9:47: note: in definition of macro 'RETURN_ENUM_AS_STRING'
    9 | #define RETURN_ENUM_AS_STRING(enumValue) case enumValue: return #enumValue;
      |                                               ^~~~~~~~~
make[2]: *** [src/CMakeFiles/openvr_api.dir/build.make:146: src/CMakeFiles/openvr_api.dir/vrcommon/hmderrors_public.cpp.o] Error 1
make[2]: Leaving directory '/tmp/makepkg/openvr/src/build'
make[1]: *** [CMakeFiles/Makefile2:98: src/CMakeFiles/openvr_api.dir/all] Error 2
make[1]: Leaving directory '/tmp/makepkg/openvr/src/build'
make: *** [Makefile:136: all] Error 2
make: Leaving directory '/tmp/makepkg/openvr/src/build'

@sl1pkn07
Copy link

sl1pkn07 commented Nov 8, 2022

fixed with #1676

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

No branches or pull requests

2 participants