compilation error arm/arch.h

compilation error arm/arch.h
0.0 0



i m trying to compile cocos2dx but i have a error.

In file included from …/kazmath/src/mat4.c:40:0:
…/kazmath/include/kazmath/neon_matrix_impl.h:31:22: fatal error: arm/arch.h: No such file or directory
compilation terminated.
make: * […/kazmath/src/mat4.o] Error 1
make: Leaving directory `/home/pi/cocos2d-2.0-x-2.0.4/cocos2dx/proj.linux’

i couldn t find arm/arch.h on my file system

i m on a raspberry pi with linux debian
i used cocos2d-2.1beta3-x-2.1.0 or cocos2d-2.0-x-2.0.4

any idea?



raspbery pi use opengl ES
could it be the origin of the problem?


I am also having exactly the same issue on arm+linux. Raspberry Pi and others.


Also have the same issue, any news on this?


I have almost succesfully compiled Cocos2d-x on my Raspberry, but here is what I had to do:

Optional: Use QEmu with a lot of extra space and more memory via a swapfile to compile faster.

Use a clean Raspbian image, execute all code here on the Raspberry Pi itself:

For prequisites install these packages (notice there’s GIT at the end, which could be prevented if you just copy the source archive to your RPi):

sudo apt-get install libx11-dev libxmu-dev libgl2ps-dev g++ libcurl4-gnutls-dev libfontconfig1-dev libsqlite3-dev libglew*-dev libgl1-mesa-dev libglfw-dev freeglut3-dev libzip-dev git

Get the latest source package of Cocos2d-x:

mkdir ~/cocos2d
cd ~/cocos2d
git clone

install RPi versions of libraries needed by Cocos2d-x:

sudo apt-get install libfreetype-dev libpng-dev libjpeg-dev libtiff-dev libwebp-dev

I don’t know whether this is needed (I think it is not, actually) but I copied all the resulting library .a files to ./cocos2dx/platform/third_party/linux to be sure the Raspberry Pi versions were linked into the build.
install libopenal on RPi
sudo apt-get install libopenal-dev libalut-dev libvorbis-dev
Tricky part here, this should actually be done in a new proj.raspberrypi copied from proj.linux. The problem is that Cocos2d-x uses FMod for the Linux build, which is not available for Raspberry Pi. So we change the ./CocosDenshion/proj.linux/Makefile to make sure Cocos2D uses Blackberry’s OpenAL code for sound:
SOURCES = …/blackberry/SimpleAudioEngine.cpp
Next problem was an error with libfreetype.a, which can be safely removed as far as I know now. As long as we only used real bitmapfonts, this is not yet a problem for now, so remove the dependency on libfreetype in ./cocos2dx/proj.linux/
#STATICLIBS = $/libfreetype.a STATICLIBS = $/libpng.a $/libjpeg.a $/libtiff.a $/libwebp.a
And, in the same file, comment out this part to remove FMod dependencies:
#ifeq ,64)
#FMOD_LIBDIR = $/CocosDenshion/third_party/fmod/lib64/api/lib
#SHAREDLIBS += ~~lfmodex64
#FMOD_LIBDIR = $/CocosDenshion/third_party/fmod/api/lib
#SHAREDLIBS = ~~lfmodex
Then change the following part in the same file to bind to OpenAL and ALUT libraries for sound:
#SHAREDLIBS +=~~L$ ~~Wl,~~rpath,$/$
=~~lopenal -lalut
Next, I encountered a bug in ./cocos2dx/kazmath/include/kazmath/neon_matrix_impl.h when it tried to include “arm/arch.h”. From what I understood, this include is only used for the __arm__ definition, which is already available when compiling for Raspberry Pi anyway, so somment it out:
#include “arm/arch.h”
Now the cocos2d libraries at least compile, but compiling the first HelloCPP example results in a LOT of “unresolved reference to…” libjpeg, libpng etc. libraries, though they
are* added as static libraries in the make files. I have no clue yet how to prevent this error from happening.

Now the biggest challenge is left: Port the OpenGL code to use OpenGLES2 calls, since this is what is supported by Raspberry Pi. Perhaps again the Blackberry code can help us out here, but I haven’t arrived there yet. I read somewhere this piece of text of someone who merged Bada code into Linux for this: “put the bada gl view code into linux and it worked…also wid some tweaks…changed initializing of openGLES to Null Windowing System,direct frame buffer that is.”. Let’s hope this part is not that hard… Who can help us out further here?


libjpeg, libpng etc are incompatible with arm. You must recompile them from source and replace .a files. I made it built and run the test, but like you said it uses OpenGL and not OpenGLES. The result is in 0.5 fps. I need a further hand.