Forum Discussion
tmason101
11 years agoHonored Guest
Oculus SDK 0.4.4 - Errors within OVR_CAPI_GL.h
Hello,
After downloading and attempting to use the new Oculus SDK 0.4.4 I now receive the following errors when attempting to compile:
Within OVR_CAPI_GL.H (line 65):
This line gives me the following error:
206 IntelliSense: this operator is not allowed in a constant expression ...LibOVR\Src\OVR_CAPI_GL.h
In addition, in the same file, on this line (line 37):
I get the following errors:
Error 27 error C2146: syntax error : missing ';' before identifier 'Window' ...LibOVR\Src\OVR_CAPI_GL.h
Error 28 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...LibOVR\Src\OVR_CAPI_GL.h
Is there a new include file I am missing?
I didn't have these problems in the Oculus SDK 0.4.3.
Thank you for your time.
After downloading and attempting to use the new Oculus SDK 0.4.4 I now receive the following errors when attempting to compile:
Within OVR_CAPI_GL.H (line 65):
static_assert(offsetof(ovrGLTextureData, TexId) == offsetof(ovrTexture, PlatformData), "Mismatch of structs that are presumed binary equivalents.");
This line gives me the following error:
206 IntelliSense: this operator is not allowed in a constant expression ...LibOVR\Src\OVR_CAPI_GL.h
In addition, in the same file, on this line (line 37):
HWND Window;
I get the following errors:
Error 27 error C2146: syntax error : missing ';' before identifier 'Window' ...LibOVR\Src\OVR_CAPI_GL.h
Error 28 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...LibOVR\Src\OVR_CAPI_GL.h
Is there a new include file I am missing?
I didn't have these problems in the Oculus SDK 0.4.3.
Thank you for your time.
8 Replies
- cyberealityGrand ChampionWhat are you trying to build?
Do the samples compile (like TinyRoom)? - tmason101Honored Guest
"cybereality" wrote:
What are you trying to build?
A custom project that I have been working on for a while that uses QT, OpenGL, GLEW and LibOVR."cybereality" wrote:
Do the samples compile (like TinyRoom)?
The samples dpo compile; I suspect it's because the samples are for DirectX. I am building on Windows. Is it possible to test an OpenGL version of the samples on Windows? - tmason101Honored GuestSo with the OculusWorldDemo I see I can switch to OpenGL and have it render with OpenGL. That does work.
I'll look through the demo but is there anything quick that people may know as to why the above errors occur?
Any notable changes that would cause the above errors to occur?
Thank you for your time. - jhericoAdventurer
"tmason101" wrote:
Any notable changes that would cause the above errors to occur?
The latest version of the SDK uses the OVR_ALIGNAS macro to try to ensure that all the structures defined in the C and GL headers have the same alignment. Previously, the structures would have different alignments in 32 bit and 64 bit mode and effectively hid some of the data values depending on whether you were looking at a given piece of memory as a, for instance, ovrGLTextureData or ovrTexture.
If you're getting that error, it sounds as if your compiler isn't respecting the alignment declaration. - tmason101Honored Guest
"jherico" wrote:
"tmason101" wrote:
Any notable changes that would cause the above errors to occur?
The latest version of the SDK uses the OVR_ALIGNAS macro to try to ensure that all the structures defined in the C and GL headers have the same alignment. Previously, the structures would have different alignments in 32 bit and 64 bit mode and effectively hid some of the data values depending on whether you were looking at a given piece of memory as a, for instance, ovrGLTextureData or ovrTexture.
If you're getting that error, it sounds as if your compiler isn't respecting the alignment declaration.
Hmmm, thanks. I am using VC 2013.
Is there a #define I need to enable or change? - jhericoAdventurerNot that I know of. I'm using VS2013 as well, and I don't get that error. I've built the 0.4.4 code in both 32 and 64 bit using my CMake configuration in my repository here: https://github.com/jherico/OculusSDK
I don't get that error.
Given that you can build the samples, and you're working with a custom project, there must be a C++ compile setting in your project that is conflicting with the SDK. Look for a /Zp command line switch in your compile settings, or check the Code Generation page in the C++ settings for your project properties. There is a 'Struct Member Alignment' setting. If it's not set to 'default' that might be your problem. - tmason101Honored Guest
"jherico" wrote:
Not that I know of. I'm using VS2013 as well, and I don't get that error. I've built the 0.4.4 code in both 32 and 64 bit using my CMake configuration in my repository here: https://github.com/jherico/OculusSDK
I don't get that error.
Given that you can build the samples, and you're working with a custom project, there must be a C++ compile setting in your project that is conflicting with the SDK. Look for a /Zp command line switch in your compile settings, or check the Code Generation page in the C++ settings for your project properties. There is a 'Struct Member Alignment' setting. If it's not set to 'default' that might be your problem.
Thanks for all of your help thus far; but no dice. I don't have that command line switch and the option is set to the default.
Reviewing the errors, it seems that there is some conflict with the windows related HWND and HDC types.
These are where I get the errors...
Maybe because of the updates I need to now specify items in a certain order?
Thanks to anyone for their help. - cyberealityGrand ChampionI think the issue was a missing include in OVR_CAPI_GL.h:
#include <Windows.h>
This has since been fixed, but in an unreleased branch. Just adding that line should fix it I believe.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 month ago