Oculus library linking question...
So I'm trying to setup an incredibly simple oculus application for test purposes that just gets the orientation from the oculus and prints it to standard out (it's a terminal c++ application).
I haven't so far been able to properly link the oculus sdk to my program, and I can't find where the problem is. I haven't found anyone else with a similar problem on the internet so far, which means I'm probably doing something wrong.
Here's my problem...
All ovr functions calls are listed as undefined references. Which leads me to believe the library isn't linked the way it should be.
Here's what I've done...
I have the windows sdk downloaded and I've tried the same general linking steps with both g++ and Visual Studio. I've specified the folder/file for the header file where OVR_CAPI.h is located, and I've specified the oculus library files in libOVR/Lib as additional dependencies (and added the path to them to the search path). None of this changes anything. The header file is being located because it doesn't throw an error on the include, but it doesn't find any of the functions, even ovr_initialize is treated as undefined.
I'll admit it's been awhile since I coded a c++ project so I could just be forgetting something about library linking and it not be oculus specific, either way if anyone has any idea what I'm missing I'd appreciate any help.
If anyone wants any additional information let me know.
I haven't so far been able to properly link the oculus sdk to my program, and I can't find where the problem is. I haven't found anyone else with a similar problem on the internet so far, which means I'm probably doing something wrong.
Here's my problem...
All ovr functions calls are listed as undefined references. Which leads me to believe the library isn't linked the way it should be.
Here's what I've done...
I have the windows sdk downloaded and I've tried the same general linking steps with both g++ and Visual Studio. I've specified the folder/file for the header file where OVR_CAPI.h is located, and I've specified the oculus library files in libOVR/Lib as additional dependencies (and added the path to them to the search path). None of this changes anything. The header file is being located because it doesn't throw an error on the include, but it doesn't find any of the functions, even ovr_initialize is treated as undefined.
I'll admit it's been awhile since I coded a c++ project so I could just be forgetting something about library linking and it not be oculus specific, either way if anyone has any idea what I'm missing I'd appreciate any help.
If anyone wants any additional information let me know.
// Include the OculusVR SDK
using namespace std;
#include <iostream>
#include "OVR.h" // Include the OculusVR SDK
ovrHmd hmd; // The handle of the headset
void Initialization() {
// Initalize the Oculus
ovr_Initialize();
// Create an Oculus Device
hmd = ovrHmd_Create(0);
// Tracking configuration
ovrHmd_ConfigureTracking(hmd, ovrTrackingCap_Orientation |
ovrTrackingCap_MagYawCorrection |
ovrTrackingCap_Position, 0);
int frame = 0;
while (true) {
ovrHmd_BeginFrameTiming(hmd, frame);
ovrTrackingState trackState = ovrHmd_GetTrackingState(hmd, ovr_GetTimeInSeconds());
ovrQuatf curOrient = trackState.HeadPose.ThePose.Orientation;
cout << curOrient.x << " " << curOrient.y << " " << curOrient.z << curOrient.w << endl;
ovrHmd_EndFrameTiming(hmd);
frame++;
}
}
int main(int argc, const char* argv[])
{
Initialization();
}
