cancel
Showing results for 
Search instead for 
Did you mean: 

Standalone C++ program to connect to Oculus linking error

souvik
Honored Guest
Hi,

I'm trying to write a ridiculously simple C++ program that I want to build on command line or with a Makefile that can connect to my Oculus Rift DK2, and eventually give me the orientation of my head (the 3 Euler angles, say). For now I'm just trying to connect to the HMD, and failing to link to the correct libraries. I'm on a Mac (I know, the developers' veto etc), SDK version 0.5.0.1 that I downloaded several months ago (before they pulled it and the runtime). And this is my silly program:


#include <iostream>
#include "/Users/souvik/CMSRift/OculusSDK/LibOVR/Include/OVR_CAPI.h"

int main()
{
ovr_Initialize();
int nHMD=ovrHmd_Detect();
std::cout<<"nHMD = "<<nHMD<<std::endl;
return 0;
}


I try to build it using:


c++ Oculus.cc -L ../OculusSDK/LibOVR/Obj/Mac/Release/LibOVR.build/Objects-normal/x86_64/


and get the following linker error:


Undefined symbols for architecture x86_64:
"_ovrHmd_Detect", referenced from:
_main in Oculus-386453.o
"_ovr_Initialize", referenced from:
_main in Oculus-386453.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


So, where is the equivalent of the libovr.lib or whatever library it is that I need to link against?

Thanks!
Souvik

PS: Where am I going with this? I'm trying to make an event display for the CMS experiment at the LHC, and I have to interface it with the standard programs used in high energy physics for this purpose. Hence my ground-up effort to understand the Rift.
0 REPLIES 0
Still need help?

Did this answer your question? If it didn’t, use our search to find other topics or create your own and other members of the community will help out.

If you need an agent to help with your Meta device, please contact our store support team here.

Having trouble with a Facebook or Instagram account? The best place to go for help with those accounts is the Facebook Help Center or the Instagram Help Center. This community can't help with those accounts.

Check out some popular posts here:

Getting Help from the Meta Quest Community

Tips and Tricks: Charging your Meta Quest Headset

Tips and Tricks: Help with Pairing your Meta Quest

Trouble With Facebook/Instagram Accounts?