I have some problems with using an external library/SDK. I am using Qt Creator under Ubuntu with the Oculus Rift SDK. The Oculus Rift SDK consists of a platform dependent lib file and some c++ source code. Note that I highly doubt my problem is in any way specific to the Oculus SDK or Xinerama.
I used the wizard and added the SDK as an external library. This was the result:
unix:!macx: LIBS += -L$$PWD/../OculusSDK/LibOVR/Lib/Linux/Release/x86_64/ -lovr
INCLUDEPATH += $$PWD/../OculusSDK/LibOVR/Include
DEPENDPATH += $$PWD/../OculusSDK/LibOVR/Include
unix:!macx: PRE_TARGETDEPS += $$PWD/../OculusSDK/LibOVR/Lib/Linux/Release/x86_64/libovr.a
Now I should be able to call methods from the SDK. However, this is one of the errors I get while compiling:
/home/me/OculusSDK/LibOVR/Lib/Linux/Release/x86_64/libovr.a(OVR_Linux_HMDDevice.o):-1: In function `OVR::Linux::HMDDeviceFactory::EnumerateDevices(OVR::DeviceFactory::EnumerateVisitor&)':
OVR_Linux_HMDDevice.cpp:-1: error: undefined reference to `XineramaIsActive'
I already tried adding this line to my .pro file but nothing changed:
unix:LIBS += -lXinerama
If I include the very same header file as OVR_Linux_HMDDevice.cpp does,
#include <X11/extensions/Xinerama.h>
I can successfully call XineramaIsActive from my code. So apparently, it's just the external source code that has issues accessing the method.
Any ideas what changes I have to make to the build process for this to work?