Compile error on Raspberry Pi 2
I am getting this error compiling apkenv on Raspberry Pi 2:
... -e CC linker/strlcpy.o -e CC linker/dlfcn.o -e CC compat/gles2_wrappers.o In file included from compat/gles2_wrappers.c:4:0: /opt/vc/include/GLES2/gl2.h:49:26: error: two or more data types in declaration specifiers /opt/vc/include/GLES2/gl2.h:49:1: warning: useless type name in empty declaration [enabled by default] makefile:84: recipe for target 'compat/gles2_wrappers.o' failed make: *** [compat/gles2_wrappers.o] Error 1
Any ideas ?
What is the code surrounding line 49 in /opt/vc/include/GLES2/gl2.h?
http://pastebin.com/6y2qFZuJ
try disabling the -DGLchar=char option (in platform/YOURPLATFORM.mk)
There is no platform for RPi 2. Maybe pandora ? But there is no -DGLchar=char in platform/pandora.mk...
you probably have to create a new platform makefile, it can be set in config.mk (PLATFORM)
I do not have the knowledge to create the platform.mk for the raspberry pi 2 but i can provide any info if needed to the developers.
A specific build for the pi 2 would indeed be very cool
@enen92 @diogomsantos check out https://github.com/krnlyng/apkenv/tree/beaglebone this should be also usable to build for the rpi 2 (BUT: it does not work yet)
Sorry for the late response, have been some days out. @krnlyng tried your beaglebone branch but I got the exactly same error. I just cloned your branch and did BEAGLEBONE=1 make, should I use anything else ?
sorry i was away too. you have an incorrect command line, it is supposed to be: PLATFORM=beaglebone make
It passed the gles error but now I get this:
...
-e CC compat/gles2_wrappers.o
-e CC compat/linux_wrappers.o
-e CC compat/pthread_wrappers.o
compat/pthread_wrappers.c: In function ‘apkenv_my_pthread_attr_setstackaddr’:
compat/pthread_wrappers.c:228:5: warning: ‘pthread_attr_setstackaddr’ is deprecated (declared at /usr/include/pthread.h:355) [-Wdeprecated-declarations]
compat/pthread_wrappers.c: In function ‘apkenv_my_pthread_attr_getstackaddr’:
compat/pthread_wrappers.c:234:5: warning: ‘pthread_attr_getstackaddr’ is deprecated (declared at /usr/include/pthread.h:347) [-Wdeprecated-declarations]
compat/pthread_wrappers.c: In function ‘apkenv_set_realrwlock’:
compat/pthread_wrappers.c:777:20: warning: comparison between pointer and integer [enabled by default]
-e CC compat/libc_wrappers.o
-e CC compat/gles_wrappers.o
-e CC compat/liblog_wrappers.o
-e CC compat/hooks.o
-e CC compat/hooks_shm.o
compat/hooks_shm.c: In function ‘_apkenv_shm_init’:
compat/hooks_shm.c:139:21: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]
-e CC compat/egl_wrappers.o
-e CC apklib/apklib.o
-e CC apklib/unzip.o
-e CC apklib/ioapi_mem.o
-e CC apklib/ioapi.o
-e CC jni/shlib.o
-e CC jni/jnienv.o
-e CC imagelib/imagelib.o
-e CC imagelib/loadjpeg.o
-e CC imagelib/loadpng.o
-e CC debug/debug.o
-e CC debug/wrappers.o
-e CC debug/wrappers/wrapper_code_arm.o
-e CC debug/wrappers/wrapper_code_generic_arm.o
-e CC (TH) debug/wrappers/wrapper_code_thumb.o
/tmp/cc42TpP1.s: Assembler messages:
/tmp/cc42TpP1.s:25: Error: invalid register list to push/pop instruction -- push {r0-r11,lr}' /tmp/cc42TpP1.s:26: Error: selected processor does not support Thumb modeldrd r0,fun'
/tmp/cc42TpP1.s:28: Error: selected processor does not support Thumb mode ldrd r1,name' /tmp/cc42TpP1.s:29: Error: selected processor does not support Thumb modeldrd r2,str'
/tmp/cc42TpP1.s:30: Error: selected processor does not support Thumb mode ldrd r4,tc' /tmp/cc42TpP1.s:32: Error: invalid register list to push/pop instruction --pop {r0-r11,lr}'
makefile:76: recipe for target 'debug/wrappers/wrapper_code_thumb.o' failed
make: *** [debug/wrappers/wrapper_code_thumb.o] Error 1
Beaglebone is armv6 right? Raspberry Pi 2 is armv7 maybe thats the problem.
please try my rpi2 branch: https://github.com/krnlyng/apkenv/tree/rpi2 compile with: PLATFORM=rpi2 make
-e CC accelerometer/accelerometer.o -e CC audio/audio.o -e CC mixer/mixer.o -e CC platform/rpi2.o In file included from platform/rpi2.c:37:0: platform/common/sdl_audio_impl.h: In function ‘sdl_audio_open’: platform/common/sdl_audio_impl.h:52:22: warning: assignment from incompatible pointer type [enabled by default] In file included from platform/rpi2.c:38:0: platform/common/sdl_mixer_impl.h: At top level: platform/common/sdl_mixer_impl.h:33:23: fatal error: SDL_mixer.h: No such file or directory compilation terminated. makefile:89: recipe for target 'platform/rpi2.o' failed make: *** [platform/rpi2.o] Error 1
I tried to change platform/rpi2.mk to LDFLAGS += -lSDL_mixer but with the same error. Dont know if SDL2_mixer is really needed, it is not on Raspbian repos, but I have SDL_mixer installed and SDL_mixer.h by default is in /usr/include/SDL/SDL_mixer.h. I can try to compile SDL2 Mixer if it is really needed.
@diogomsantos: can you install SDL2 and SDL2_mixer from the default repositories? also the devel packages. for beaglebone these were available so i figured it should work for the rpi2 too, if not we have to rewrite a little bit of the platform code, but not much EDIT: maybe join #apkenv on freenode
I'll close this issue the next time I'll go through the list of open issues if there's no progress here.