Skip to main content
Participant
Jun 23, 2017 6:45 PM UTC

Oculus SDK and Visual Studio 2015 setup


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

    Participant
    Jun 23, 2017 11:08 PM UTC
    Sorry that was #include iostream, and #include OVR_CAPI.h
    Participant
    Jun 26, 2017 5:42 PM UTC
    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;
    Participant
    Jun 30, 2017 4:42 PM UTC
    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...
    Participant
    Jun 30, 2017 6:24 PM UTC
    Huh, if I change it to Release, then it doesn't like the like "#include <OVR_CAPI.h>" anymore...
    Participant
    Jun 30, 2017 6:29 PM UTC
    Or if I just change the x64 setting, same thing.  Should have to reset the include libraries when I change those build settings?
    Participant
    Jul 11, 2017 5:25 PM UTC
    Thanks, I believe I'm using SDK 1.15.0