Wolfmanfx , Thanks for your great work! Finally a running ogre in android!
I want to ask, if I want to hook an ogre project to an android project, how can this be done in eclipse? Mind giving some pointer here? As I need to pack the mini game to an android application.
Thanks so much!
BTW, I wrap up the configuration in a bat file as below for the configuration before nmake. Hope someone may find this helpful.
Ok - I'm getting somewhere - the phone has an arm6 CPU and I noticed that the lib folder has a subfolder called "armeabi-v7a", whereas my other apps use the folder name "armeabi".
@BigDave2001
Ah no it will not work on arm6 because i compiled everything for armv7 - to get it work i must rebuild everything and create a fat binary containing both versions.
So renaming will crash hard.
@haydenli
It should work on windows try to recreate the MSVC project (delete the cmake build folder) these linker errors mean that the cpp file is not included.
If its still not working you can disable ETC support via CMake gui.
I just worked out that if I changed the application.mk that I could specify the non-arm 7 (but it still crashes), but are you saying that wouldn't be enough, there are other dependencies on Arm 7?
Out of interest, in that case, when releasing apps is it possible to specify to users that the CPU must be Arm7 - is there a way to do that?
I'm trying to compile everything on a Linux box. So far everything goes fine, I have Ogre compiled, as well as libOgreSampleBrowser.so. However, I can't seem to be able to build the APK. Is Eclipse needed? What steps am I missing to build the apk?
firsthand to generate a build.xml for ant though. Then "ant debug" built the apk. Testing in a few minutes on a Galaxy S3 and later today on a Galaxy Note, Galaxy Nexus and TF300T!
Edit: All black on a Galaxy S III (I only see the "BSP" sample title). I smell some textures compatibility issues there.
Edit2: All black but text and colored objects on TF300T too. Could something be wrong by building the way I did? (textures not getting packed)
Edit3: PNG codec not found - I'm missing FreeImage. Lib is installed but CMake doesn't find it
Stop editing the same post because then i do not get a notification.
Yeah just look some posts up you have to use the deps i precompiled and you can add the freeimage paths through console or gui then everything will work.
Stop editing the same post because then i do not get a notification.
Yeah just look some posts up you have to use the deps i precompiled and you can add the freeimage paths through console or gui then everything will work.
Yeah sorry - I just didn't want to flood the topic either
After manually entering FreeImage path to CMake, it works well (although a bit slow, 20-30fps on most demos, but it might be because I'm running a debug build made with "ant debug").
I find that if I use ndk-build in the command prompt there is no such error when createLog(), but when I run the ndk-builder using eclipse there is no way to avoid this.
Mind asking do you know how can we add open the android camera underneath the Ogre view layer? As we are targeting to make an AR browser, we need to be able to preview the camera output.
I'm an android developer and I have extensive experience with the NDK. I see you're well under way, just curious if you can give me a run-down of where you're at and more specifically what you need help with if anything. Thanks and great work.
Downloaded from first post. Now how to compile? Cannot find any tutorial. Simply run cmake-gui on Ubuntu and copy over to my Sony?
PS: Now that's what I get:
michael@michael-ubuntu:~/ogre/build/Samples$ make
[ 0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAutoParamDataSource.cpp.o
In file included from /home/michael/ogre/OgreMain/include/OgreMatrix4.h:35:0,
from /home/michael/ogre/OgreMain/include/OgreAutoParamDataSource.h:33,
from /home/michael/ogre/OgreMain/src/OgreAutoParamDataSource.cpp:30:
/home/michael/ogre/OgreMain/include/OgreMatrix3.h: In member function ‘Ogre::Real* Ogre::Matrix3::operator[](size_t) const’:
/home/michael/ogre/OgreMain/include/OgreMatrix3.h:117:24: warning: cast from type ‘const Real* {aka const float*}’ to type ‘Ogre::Real* {aka float*}’ casts away qualifiers [-Wcast-qual]
In file included from /home/michael/ogre/OgreMain/include/OgreRoot.h:39:0,
from /home/michael/ogre/OgreMain/src/OgreAutoParamDataSource.cpp:36:
/home/michael/ogre/OgreMain/include/OgreWorkQueue.h: At global scope:
/home/michael/ogre/OgreMain/include/OgreWorkQueue.h:475:4: error: expected ‘;’ at end of member declaration
/home/michael/ogre/OgreMain/include/OgreWorkQueue.h:532:3: error: expected ‘;’ at end of member declaration
make[2]: *** [OgreMain/CMakeFiles/OgreMain.dir/src/OgreAutoParamDataSource.cpp.o] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2
michael@michael-ubuntu:~/ogre/build/Samples$
I'm an android developer and I have extensive experience with the NDK. I see you're well under way, just curious if you can give me a run-down of where you're at and more specifically what you need help with if anything. Thanks and great work.
Hey Furinax,
As I have very little knowledge on NDK, mind asking do you have any idea of how to add a camera preview layer underneath the ogre render window so that I can make a AR browser?
Is it possible for you to give step-by-step guide to compile ogre on android....???????
Thanx........
If Win platform:
Pre-request:
1. visual studio xxx
2. cmake , and make sure cmake executable is in the PATH environment
3. ant , and make sure ant executable is in the PATH environment
4. environment variable: ANDROID_NDK is pointing to the root NDK path, make sure this path is also included in the PATH environment, so ndk-build can be called
5. environment variable: ANDROID_SDK is pointing to the root SDK path, make sure the tools in this path is also included in the PATH environment, so the sdk tools can be accessed in the terminal
Steps:
1. Download from: https://bitbucket.org/wolfmanfx/ogre to a desired location
2.Download dependencies from: http://www.coderabbit.at/AndroidDependencies.zip
3. Extract the dependencies to the location in step 1 (so you will have something like: desiredLocation/AndroidDependencies)
4. Create a bat file under desiredLocation as below, name it as configure-android.bat:
@echo off
set MAINFOLDER=%CD%
if "%1" == "" (
echo "Enter build target directory."
@exit /b 1
)
if "%LIBPATH%" == "" (
echo "Warning: vc++ environment is missing."
)
if not exist %1 (
mkdir %1
)
cd %1
cmake %MAINFOLDER% -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE="%MAINFOLDER%/CMake/toolchain/android.toolchain.cmake" -DOGRE_DEPENDENCIES_DIR="%MAINFOLDER%/AndroidDependencies" -DTargetPlatform="Android" -DOGRE_BUILD_RENDERSYSTEM_GLES2=TRUE -DOGRE_STATIC=TRUE -DANDROID_NATIVE_API_LEVEL=14 -DOGRE_BUILD_COMPONENT_PAGING=FALSE -DOGRE_BUILD_COMPONENT_TERRAIN=FALSE -DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=TRUE -DOGRE_BUILD_PLUGIN_BSP=FALSE -DOGRE_BUILD_PLUGIN_PCZ=FALSE -DOGRE_BUILD_RENDERSYSTEM_GLES=FALSE -DOGRE_BUILD_TESTS=FALSE -DOGRE_BUILD_TOOLS=FALSE
rem cd %MAINFOLDER%
5. Open a VS terminal or a normal terminal then run "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat" (if you installed Microsoft Visual Studio somewhere else, of course use that path instead)
6. Go to the location in step 1 in the terminal then run
Hi
make doesn't create the samplebrowserndk, hence I try:
/home/michael/Android-dev/android-sdk-linux/tools/android create project --target 10 --name SampleBrowserNDK --path ./SampleBrowserNDK --activity SampleBrowserNDKActivity --package com.example.SampleBrowserNDK
After that I do: ant debug
What's wrong with the above? I get a hello world but not a samplebrowser.
Thanks
PS: how do I add: Tip: Add the platform-tools/ as well as the tools/ directory to your PATH environment variable.
in .bashrc I've:
export NDK=/home/michael/Android-dev/android-ndk-r8
export ANDROID_NDK=/home/michael/Android-dev/android-ndk-r8
export NDK_BIN=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
export PATH=$PATH:$NDK_BIN
but no idea on how to add more...
Last edited by mike_cyber on Wed Jul 18, 2012 10:30 am, edited 5 times in total.
Did someone successfully compiled the browser on a linux distro ?
I'm following the steps in the thread but i only got OgreMain, RTSS, ParticleFX and OpenGL ES 2.0 RS components compiled ?
Here's what I do.
1. Clone the repo.
2. Setup my ANDROID_NDK and ANDROID_SDK env variables.
3. Then made a dir in the main source tree called Android and cd to it.
4. Download the precompiled deps and extract them into the Android dir made in step 3 .
5. Then run
Following haydenli steps 1,2,3. Then copied AndroidDependencies also to Dependencies
4. cmake-gui
5. michael@michael-ubuntu:~/ogre/build$ cmake /home/michael/ogre -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/home/michael/ogre/CMake/toolchain/android.toolchain.cmake" -DOGRE_DEPENDENCIES_DIR="/home/michael/ogre/AndroidDependencies" -DTargetPlatform="Android" -DOGRE_BUILD_RENDERSYSTEM_GLES2=TRUE -DOGRE_STATIC=TRUE -DANDROID_NATIVE_API_LEVEL=14 -DOGRE_BUILD_COMPONENT_PAGING=FALSE -DOGRE_BUILD_COMPONENT_TERRAIN=FALSE -DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=TRUE -DOGRE_BUILD_PLUGIN_BSP=FALSE -DOGRE_BUILD_PLUGIN_PCZ=FALSE -DOGRE_BUILD_RENDERSYSTEM_GLES=FALSE -DOGRE_BUILD_TESTS=FALSE -DOGRE_BUILD_TOOLS=FALSE
make sure to have all dependencies. I had to add some libs manually to CMakeCache.txt
6. make
I got some errors, easy to fix add ; and such.
Now I'm stuck here:
Linking CXX static library ../../lib/libRenderSystem_GLStatic.a
[ 61%] Built target RenderSystem_GL
Scanning dependencies of target RenderSystem_GLES2
[ 61%] Building CXX object RenderSystems/GLES2/CMakeFiles/RenderSystem_GLES2.dir/src/OgreGLES2Context.cpp.o
In file included from /home/michael/ogre/RenderSystems/GLES2/include/OgreGLES2Context.h:32:0,
from /home/michael/ogre/RenderSystems/GLES2/src/OgreGLES2Context.cpp:29:
/home/michael/ogre/RenderSystems/GLES2/include/OgreGLES2Prerequisites.h:76:26: fatal error: GLES2/gl2.h: No such file or directory
compilation terminated.
make[2]: *** [RenderSystems/GLES2/CMakeFiles/RenderSystem_GLES2.dir/src/OgreGLES2Context.cpp.o] Error 1
make[1]: *** [RenderSystems/GLES2/CMakeFiles/RenderSystem_GLES2.dir/all] Error 2
make: *** [all] Error 2
I found multiple at:
/home/michael/Android-dev/android-ndk-r8/platforms/android-14/arch-arm/usr/include/GLES2
or
/home/michael/Android-dev/android-ndk-r8/platforms/android-14/arch-x86/usr/include/GLES2
etc.
What should I use on Ubuntu 12.04 64bit? arch-x86?
Thanks and cheers. I'll report/modify later this post.
Michael