cancel
Showing results for 
Search instead for 
Did you mean: 

Oculus SDK and Visual Studio 2015 setup

adam_schneider4
Honored Guest

I am very new to Visual Studio, C++ and the Oculus SDK, but have experience with Fortran, Matlab, and coding in general.

I have got the basic C++ libraries working, so #include works.

I have got the LibOVR directory included, so that #include works.

I opened the LibOVR project into VS2015 and rebuilt it, which worked, creating a new LibOVR.lib file.

I moved the new .lib file into my project folder and also added this file path to the Linker -> Input.

But when I try to compile my own code, the basic ovr_initialize() command is said to be undefined.

I am just trying to get a basic code setup to extract the head position data from the IMU in the Oculus Rift, and eventually hoping to integrate this with some matlab code.

Here is my starting code, mostly commented out for now:

int main()
{
int MyNumb;

cout << "Please, enter an integer: ";
cin >> MyNumb;
cin.ignore();
cout << "You entered: " << MyNumb;
cin.get();

return 1;
}

void application()
{

ovrresult result = ovr_initialize(nullptr); *THIS LINE GIVES ERROR*

// if (ovr_failure(result))
// return;
//
// ovrsession session;
// ovrgraphicsluid luid;
// result = ovr_create(&session, &luid);
// if (ovr_failure(result))
// {
// ovr_shutdown();
// return;
// }
//
// ovrhmddesc desc = ovr_gethmddesc(session);
// ovrsizei resolution = desc.resolution;
//
// ovr_destroy(session);
// ovr_shutdown();

}

Any help getting this up and running would be greatly appreciated!!

I know its finding the header files properly now, but I guess if it was linking to the .lib properly, it should know what ovr_initialize() is? Really not sure what else that could be... 

6 REPLIES 6

adam_schneider4
Honored Guest
Sorry that was #include iostream, and #include OVR_CAPI.h

adam_schneider4
Honored Guest
Hmm just realize it didn't show all my code.  There was a few more lines at the top showing:
#include <iostream>
// Include the OculusVR SDK
#include <OVR_CAPI.h>

using namespace std;

adam_schneider4
Honored Guest
Hi, thanks for the response!  I'm honestly not sure what the build settings options are, but if I go into the configuration manager under the build menu, its set to Debug and x86.  These seem to be fine for building the LibOVR project to get the .lib file though.  Or maybe that's why the .lib file doesn't seem to be working right?  Sorry for being such a newb here...

adam_schneider4
Honored Guest
Huh, if I change it to Release, then it doesn't like the like "#include <OVR_CAPI.h>" anymore...

adam_schneider4
Honored Guest
Or if I just change the x64 setting, same thing.  Should have to reset the include libraries when I change those build settings?

adam_schneider4
Honored Guest
Thanks, I believe I'm using SDK 1.15.0