It looks like your code doesn’t need either conio.h or curses.h, which are both platform depended includes. I just commented them both out. I also replaced those first errors with Ptr, and that worked. However, I get these errors:
[java]oculusvr_input_OculusRift.cpp: In function ‘jboolean Java_oculusvr_input_OculusRift_initialize(JNIEnv*, jobject)’:
oculusvr_input_OculusRift.cpp:25:18: error: ‘class OVR::Ptr<OVR::SensorFusion>’ has no member named ‘reset’
pFusionResult.reset(new SensorFusion);
^
In file included from /home/phr00t/OculusSDK/LibOVR/Include/…/Src/Kernel/OVR_Math.h:36:0,
from /home/phr00t/OculusSDK/LibOVR/Include/OVR.h:31,
from oculusvr_input_OculusRift.cpp:7:
/home/phr00t/OculusSDK/LibOVR/Include/…/Src/Kernel/OVR_RefCount.h: In instantiation of ‘OVR::Ptr<C>::~Ptr() [with C = OVR::SensorFusion]’:
oculusvr_input_OculusRift.cpp:15:20: required from here
/home/phr00t/OculusSDK/LibOVR/Include/…/Src/Kernel/OVR_RefCount.h:368:22: error: ‘class OVR::SensorFusion’ has no member named ‘Release’
if (pObject) pObject->Release();
^
[/java]
I comment out calls to .reset (in your code) & Release() (in the OculusSDK), just to make some progress, and it compiles. I create a shared library by running this script:
[java]g++ -c -fpic oculusvr_input_OculusRift.cpp -I/usr/lib/jvm/java-7-oracle/include/ -I/usr/lib/jvm/java-7-oracle/include/linux/ -I/home/phr00t/OculusSDK/LibOVR/Include/
g++ -shared -o libovr64.so *.o -lstdc++ -L. -lovr -ludev -lpthread -lX11 -lXinerama
ls -al libovr64.so
[/java]
“-lovr” is the static library provided by OculusSDK for Linux 64-bit (I had it in the local directory, hence the “-L.”).
I put the libovr64.so into the oculuslib.jar file (under linux/native), and I don’t get any exceptions when the library tries to load! However, I get these errors which probably have something to do with me not having an Oculus Rift:
[java]Oculus Rift could not be initialized
May 04, 2014 5:06:28 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:28 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_write
May 04, 2014 5:06:28 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:28 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:28 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:28 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_write
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
May 04, 2014 5:06:29 PM com.jme3.scene.plugins.ogre.MaterialLoader readTextureUnitStatement
WARNING: Unsupported texture_unit directive: colour_op
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007f84d42fd950, pid=4558, tid=140208708314880
JRE version: Java™ SE Runtime Environment (7.0_55-b13) (build 1.7.0_55-b13)
Java VM: Java HotSpot™ 64-Bit Server VM (24.55-b03 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [libovr64.so+0x29950] OVR::MessageHandler::GetHandlerLock() const+0x0
Failed to write core dump. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again
An error report file with more information is saved as:
/home/phr00t/jmonkeyengine-oculus-rift-read-only/hs_err_pid4558.log
If you would like to submit a bug report, please visit:
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
Initializing Rift…
No HMD, creating sensorFailed to init sensor[/java]
Here is the libovr64.so file I created:
Can you make any progress with this information & library, @rickard? I’ll continue to do whatever I can to make this work, but I may be limited by not having an Oculus Rift :S