Skip to main content
Up and Coming
September 3, 2015

0.7 VS2012 Etw* syntax errors

hi all,

I just upgraded my code to use SDK 0.7 and it all compiles fine until EtwFrameListener.h is reached, where a number of (successive and related) syntax errors crop up. I am trying to compile on Win 8.1 VS2012 Express. I previously worked with 0.6.0.1 which compiled fine, but that version did not have Etw* files. Any suggestions?

Error	1	error C2143: syntax error : missing ';' before '='	[...]sources\libovrkernel\src\tracing\EtwFrameListener.h	23	1	Oculus_Rift_VR
Error 2 error C2873: 'EtwProcessCallback' : symbol cannot be used in a using-declaration [...]sources\libovrkernel\src\tracing\EtwFrameListener.h 23 1 Oculus_Rift_VR
Error 3 error C2513: 'int' : no variable declared before '=' [...]sources\libovrkernel\src\tracing\EtwFrameListener.h 23 1 Oculus_Rift_VR
Error 4 error C2061: syntax error : identifier 'EtwProcessCallback' [...]sources\libovrkernel\src\tracing\EtwFrameListener.h 65 1 Oculus_Rift_VR
Error 5 error C2065: 'EtwProcessCallback' : undeclared identifier [...]Sources\LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 41 1 Oculus_Rift_VR
Error 6 error C2146: syntax error : missing ')' before identifier 'eventHandler' [...]Sources\LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 41 1 Oculus_Rift_VR
Error 7 error C2761: 'void OVR::Etw::EtwFrameListener::HandleEvents(void)' : member function redeclaration not allowed [...]Sources\LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 41 1 Oculus_Rift_VR
Error 8 error C2059: syntax error : ')' [...]Sources\LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 41 1 Oculus_Rift_VR
Error 9 error C2143: syntax error : missing ';' before '{' [...]Sources\LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 42 1 Oculus_Rift_VR
-- etc

    13 replies

    Inspiring
    September 3, 2015
    Can you compile the samples, like Oculus Room Tiny, OK?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    broozarAuthor
    Up and Coming
    September 3, 2015
    Hi, thanks for your assistance.

    Yes, TinyRoom compiles, but crashes the editor when it tries to subsequently run. No problem though as the compiled exe on its own works just fine. Although unrelated to my original question, this is the crash message, in case you need it: http://somepic.someserver.de/pics/big/d ... 9cf81e.png

    TinyRoom compiles with "VS2012 for Windows Desktop" (the bright one), while I try to compile a DLL plugin for my engine (ShiVa) with "VS2012 for Windows 8" (the dark one), maybe that is of any consequence? When I open TinyRoom in the "dark" VS2012, it shows a message next to the sample that they are "incompatible with the current edition of VS".
    However my plugin project throws the same error message on both versions of VS2012, so I don't think it matters too much. My attempts with SDK 0.6.0.1 were all compiled in the "dark" editor and it worked just fine.

    In case i did something wrong generally, here's my project config:
    Win32|Release
    c/c++ general -> additional include directories -> LibOVR/Include; LibOVRKernel/Src
    linker general -> additional library directories -> LibOVR/Lib/...; LibOVRKernel/Lib/...

    I successfully compiled LibOVRKernel earlier today, that worked well. However the output did not make it look like any of the "problematic" Etw* files in "Tracing" were compiled, only those in "GL", "Kernel" and "Util".
    Inspiring
    September 3, 2015
    Some people on the internet are saying this could be caused by a circular dependency.

    You may also want to check your header files, maybe there's a struct / class declaration without ; at the end.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Inspiring
    September 3, 2015
    Actually, it looks like that file uses C++11 features not available in VS2012. Specifically alias templates.

    So you will either have to update to VS2013, or modify that file to work on 2012.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Participant
    September 4, 2015
    We have updated the code to be compatible with VS2012 with code like this:

    #if defined(_MSC_VER) && (_MSC_VER < 1800) // If the compiler is VC++ earlier than VS2013...
    #define EtwProcessCallback std::function<void(EtwEvent**, int)>
    #else
    using EtwProcessCallback = std::function<void(EtwEvent**, int)>;
    #endif


    If there are additional problems, lets us know.
    broozarAuthor
    Up and Coming
    September 4, 2015
    hi, thanks for the quick answer. indeed there are further error messages. they can be loosely clustered into 3 groups:

    1. undeclared identifiers
    Error	1	error C2065: 'ENABLE_TRACE_PARAMETERS_VERSION_2' : undeclared identifier	[...]LibOVRKernel\Src\Tracing\EtwFrameListener.cpp	324	1	Oculus_Rift_VR
    Error 4 error C2065: 'MAX_EVENT_FILTER_EVENT_ID_COUNT' : undeclared identifier [...]LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 328 1 Oculus_Rift_VR
    Error 5 error C2065: 'MAX_EVENT_FILTER_PID_COUNT' : undeclared identifier [...]LibOVRKernel\Src\Tracing\EtwFrameListener.cpp 336 1 Oculus_Rift_VR


    2. syntax errors & warnings
    Warning	7	warning C4091: '' : ignored on left of 'double' when no variable is declared	[...]libovrkernel\src\tracing\EtwFrameUtils.h	97	1	Oculus_Rift_VR
    Error 8 error C2143: syntax error : missing ';' before ',' [...]libovrkernel\src\tracing\EtwFrameUtils.h 97 1 Oculus_Rift_VR


    3. parameter mismatch
    Error	14	error C2780: 'enable_if<!std::is_same<_Ty1,_Ty2>::value,std::_Bind<true,_Ret,std::_Pmf_wrap<_Rx(__thiscall _Farg0::* )(_V0_t,_V1_t,_V2_t,_V3_t,_V4_t) volatile const,_Rx,_Farg0,_V0_t,_V1_t,_V2_t,_V3_t,_V4_t>,_Vx0_t,_Vx1_t,_Vx2_t,_Vx3_t,_Vx4_t>>::type std::bind(_Rx (__thiscall _Farg0::* const )(_V0_t,_V1_t,_V2_t,_V3_t,_V4_t) volatile const,_Vx0_t &&,_Vx1_t &&,_Vx2_t &&,_Vx3_t &&,_Vx4_t &&)' : expects 6 arguments - 13 provided	[...]LibOVRKernel\Src\Tracing\EtwFrameUtils.cpp	40	1	Oculus_Rift_VR
    Error 15 error C2780: 'enable_if<!std::is_same<_Ty1,_Ty2>::value,std::_Bind<true,_Ret,std::_Pmf_wrap<_Rx(__thiscall _Farg0::* )(_V0_t,_V1_t,_V2_t,_V3_t,_V4_t) volatile,_Rx,_Farg0,_V0_t,_V1_t,_V2_t,_V3_t,_V4_t>,_Vx0_t,_Vx1_t,_Vx2_t,_Vx3_t,_Vx4_t>>::type std::bind(_Rx (__thiscall _Farg0::* const )(_V0_t,_V1_t,_V2_t,_V3_t,_V4_t) volatile,_Vx0_t &&,_Vx1_t &&,_Vx2_t &&,_Vx3_t &&,_Vx4_t &&)' : expects 6 arguments - 13 provided [...]LibOVRKernel\Src\Tracing\EtwFrameUtils.cpp 40 1 Oculus_Rift_VR
    broozarAuthor
    Up and Coming
    September 4, 2015
    just to be clear: while this should all be fixed, I would be totally fine if I could disable that section of code and just compile without ETW. If it's easier to just make a quick patch for that, I could continue working.
    Inspiring
    September 4, 2015
    Can you just use Visual Studio 2013?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    broozarAuthor
    Up and Coming
    September 4, 2015
    I think so, will install it and try over the weekend.
    ... still you are providing a VS2012 project, so I just assumed it would work in my own.
    broozarAuthor
    Up and Coming
    September 7, 2015
    as you probably expected, compilation with VS2013 for Windows Desktop goes through just fine. I will use it for the time being.

    on a somewhat related note, could it be that the docs have not been fully updated yet? I am finding a number of things like
    Sizei recommenedTex0Size = ovr_GetFovTextureSize(hmd, ovrEye_Left, hmd->DefaultEyeFov[0], 1.0f);

    on https://developer.oculus.com/documentat ... dg-render/ where hmd->DefaultEyeFov[0] is not valid anymore and requires dot notation from an ovrHmdDesc. is that correct?