Forum Discussion
ejonathanlindgr
7 years agoExplorer
How to make VrCubeWorld_NativeACtivity examples run as C++ code instead of C code
I am exploring the VrCubeWorld_NativeActivity example in VrSamples of the Mobile SDK. I can successfully compile and run it on my oculus go using Android Studio. I would now like to start with that source code and modify it for my own project as a starting point as I am quite new to android/VR development.
in Android.mk, does not work, Android Studio build fails with an org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':MyProjects:Test:Projects:Android'. exception.
Is there a quick way to modify the VrCubeWorld_* examples in VrSamples so they compile as C++ code instead of C code? How should I modify the gradle files and .mk files? I am very new to gradle etc so that is still magic to me.
However, I would like to use C++ instead of C, but I am not able to compile the project as a C++ project. Renaming the file to a .cpp file and adding
LOCAL_CPPFLAGS := -std=c++11in Android.mk, does not work, Android Studio build fails with an org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':MyProjects:Test:Projects:Android'. exception.
Is there a quick way to modify the VrCubeWorld_* examples in VrSamples so they compile as C++ code instead of C code? How should I modify the gradle files and .mk files? I am very new to gradle etc so that is still magic to me.
2 Replies
- ejonathanlindgrExplorer@imperativity do you have any insight into this problem, or where to find help about it?
- ejonathanlindgrExplorerI managed to make it work, by having minimal C code as entry point for the native application, and then calling a C++ code from the C code where I moved the VrCubeWorld source code, with some minor changes to the source code such that it is valid C++. If anyone is interested I could write up how to do it
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 7 months ago