[Android Q&A, Help & Troubleshooting] liorry:
I've been trying to compile the ICS/JB Camera application from sources.

Tried both Android sources and CyanogenMod camera app sources.

I got all the classes and resources I need and even managed to make the camera application run and work with stills and video recording.

The only problem I encountered is the Panorama mode, which is the whole reason I'm doing that in the first place :)

The Panorama mode requires the libjni-mosaic.so shared library.

I downloaded the JNI folder from CyanogenMod sources and using Cygwin and Android-NDK-r8 I tried to build the cpp files.

It started out good but then I got this error:

Compile++ thumb : jni_mosaic <= feature_mos_jni.cpp
Compile++ thumb : jni_mosaic <= mosaic_renderer_jni.cpp
Compile++ thumb : jni_mosaic <= trsMatrix.cpp
Compile++ thumb : jni_mosaic <= AlignFeatures.cpp
Compile++ thumb : jni_mosaic <= Blend.cpp
Compile++ thumb : jni_mosaic <= Delaunay.cpp
Compile++ thumb : jni_mosaic <= ImageUtils.cpp
Compile++ thumb : jni_mosaic <= Mosaic.cpp
Compile++ thumb : jni_mosaic <= Pyramid.cpp
Compile++ thumb : jni_mosaic <= Renderer.cpp
Compile++ thumb : jni_mosaic <= WarpRenderer.cpp
Compile++ thumb : jni_mosaic <= SurfaceTextureRenderer.cpp
Compile++ thumb : jni_mosaic <= YVURenderer.cpp
Compile++ thumb : jni_mosaic <= FrameBuffer.cpp
Compile++ thumb : jni_mosaic <= db_feature_detection.cpp
Compile++ thumb : jni_mosaic <= db_feature_matching.cpp
Compile++ thumb : jni_mosaic <= db_framestitching.cpp
Compile++ thumb : jni_mosaic <= db_image_homography.cpp
Compile++ thumb : jni_mosaic <= db_rob_image_homography.cpp
Compile++ thumb : jni_mosaic <= db_utilities.cpp
Compile++ thumb : jni_mosaic <= db_utilities_camera.cpp
Compile++ thumb : jni_mosaic <= db_utilities_indexing.cpp
Compile++ thumb : jni_mosaic <= db_utilities_linalg.cpp
Compile++ thumb : jni_mosaic <= db_utilities_poly.cpp
Compile++ thumb : jni_mosaic <= dbreg.cpp
Compile++ thumb : jni_mosaic <= dbstabsmooth.cpp
Compile thumb : jni_mosaic <= vp_motionmodel.c
SharedLibrary : libjni_mosaic.so
./obj/local/armeabi/objs/jni_mosaic/mosaic_renderer_jni.o: In function `bindSurfaceTexture(unsigned int)':
D:\Scamera/jni/mosaic_renderer_jni.cpp:192: undefined reference to `glBindTexture'
D:\Scamera/jni/mosaic_renderer_jni.cpp:196: undefined reference to `glTexParameterf'
D:\Scamera/jni/mosaic_renderer_jni.cpp:198: undefined reference to `glTexParameterf'
D:\Scamera/jni/mosaic_renderer_jni.cpp:201: undefined reference to `glTexParameteri'
D:\Scamera/jni/mosaic_renderer_jni.cpp:203: undefined reference to `glTexParameteri'
./obj/local/armeabi/objs/jni_mosaic/mosaic_renderer_jni.o: In function `Java_com_scam_app_camera_panorama_MosaicRenderer_init':
D:\Scamera/jni/mosaic_renderer_jni.cpp:500: undefined reference to `glBindFramebuffer'
D:\Scamera/jni/mosaic_renderer_jni.cpp:502: undefined reference to `glGenTextures'
./obj/local/armeabi/objs/jni_mosaic/mosaic_renderer_jni.o: In function `checkGlError(char const*)':
D:\Scamera/jni/mosaic_renderer_jni.cpp:182: undefined reference to `glGetError'
./obj/local/armeabi/objs/jni_mosaic/mosaic_renderer_jni.o: In function `Java_com_scam_app_camera_panorama_MosaicRenderer_transferGPUtoCPU':
D:\Scamera/jni/mosaic_renderer_jni.cpp:668: undefined reference to `glBindFramebuffer'
D:\Scamera/jni/mosaic_renderer_jni.cpp:676: undefined reference to `glReadPixels'
D:\Scamera/jni/mosaic_renderer_jni.cpp:681: undefined reference to `glBindFramebuffer'
D:\Scamera/jni/mosaic_renderer_jni.cpp:689: undefined reference to `glReadPixels'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/Renderer.o: In function `Renderer::SetupGraphics(FrameBuffer*)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:157: undefined reference to `glUseProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:160: undefined reference to `glBindFramebuffer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:166: undefined reference to `glViewport'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/Renderer.o: In function `Renderer::SetupGraphics(int, int)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:126: undefined reference to `glUseProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:129: undefined reference to `glBindFramebuffer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:135: undefined reference to `glViewport'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/Renderer.o: In function `Renderer::Clear(float, float, float, float)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:185: undefined reference to `glClearColor'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:186: undefined reference to `glClear'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/Renderer.o: In function `Renderer::loadShader(unsigned int, char const*)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:39: undefined reference to `glCreateShader'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:41: undefined reference to `glShaderSource'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:42: undefined reference to `glCompileShader'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:44: undefined reference to `glGetShaderiv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:47: undefined reference to `glGetShaderiv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:51: undefined reference to `glGetShaderInfoLog'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:56: undefined reference to `glDeleteShader'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/Renderer.o: In function `Renderer::createProgram(char const*, char const*)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:78: undefined reference to `glCreateProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:81: undefined reference to `glAttachShader'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:83: undefined reference to `glAttachShader'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:86: undefined reference to `glLinkProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:88: undefined reference to `glGetProgramiv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:95: undefined reference to `glGetProgramiv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:106: undefined reference to `glDeleteProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/Renderer.cpp:101: undefined reference to `glGetProgramInfoLog'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/WarpRenderer.o: In function `WarpRenderer::DrawTexture(float*)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:119: undefined reference to `glDisable'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:121: undefined reference to `glActiveTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:125: undefined reference to `glBindTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:129: undefined reference to `glUniform1i'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:133: undefined reference to `glVertexAttribPointer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:137: undefined reference to `glVertexAttribPointer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:139: undefined reference to `glEnableVertexAttribArray'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:140: undefined reference to `glEnableVertexAttribArray'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:143: undefined reference to `glUniformMatrix4fv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:144: undefined reference to `glUniformMatrix4fv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:145: undefined reference to `glUniformMatrix4fv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:148: undefined reference to `glDrawElements'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:152: undefined reference to `glBindFramebuffer'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/WarpRenderer.o: In function `WarpRenderer::InitializeGLProgram()':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:101: undefined reference to `glDeleteProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:82: undefined reference to `glUseProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:86: undefined reference to `glGetAttribLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:87: undefined reference to `glGetUniformLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:88: undefined reference to `glGetUniformLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:89: undefined reference to `glGetUniformLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:90: undefined reference to `glGetAttribLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/WarpRenderer.cpp:93: undefined reference to `glGetUniformLocation'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.o: In function `SurfaceTextureRenderer::DrawTexture(float*)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:132: undefined reference to `glDisable'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:134: undefined reference to `glActiveTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:138: undefined reference to `glBindTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:141: undefined reference to `glUniformMatrix4fv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:142: undefined reference to `glUniformMatrix4fv'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:146: undefined reference to `glVertexAttribPointer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:147: undefined reference to `glEnableVertexAttribArray'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:150: undefined reference to `glVertexAttribPointer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:151: undefined reference to `glEnableVertexAttribArray'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:154: undefined reference to `glDrawElements'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:156: undefined reference to `glBindFramebuffer'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.o: In function `SurfaceTextureRenderer::InitializeGLProgram()':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:114: undefined reference to `glDeleteProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:96: undefined reference to `glUseProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:99: undefined reference to `glGetAttribLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:101: undefined reference to `glGetAttribLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:103: undefined reference to `glGetUniformLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:105: undefined reference to `glGetUniformLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp:107: undefined reference to `glPixelStorei'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/YVURenderer.o: In function `YVURenderer::DrawTexture()':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:88: undefined reference to `glDisable'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:90: undefined reference to `glActiveTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:94: undefined reference to `glBindTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:98: undefined reference to `glUniform1i'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:102: undefined reference to `glVertexAttribPointer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:106: undefined reference to `glVertexAttribPointer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:108: undefined reference to `glEnableVertexAttribArray'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:109: undefined reference to `glEnableVertexAttribArray'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:112: undefined reference to `glDrawElements'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:116: undefined reference to `glBindFramebuffer'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/YVURenderer.o: In function `YVURenderer::InitializeGLProgram()':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:70: undefined reference to `glDeleteProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:54: undefined reference to `glUseProgram'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:58: undefined reference to `glGetAttribLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:59: undefined reference to `glGetAttribLocation'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/YVURenderer.cpp:62: undefined reference to `glGetUniformLocation'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.o: In function `FrameBuffer::CreateBuffers()':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:70: undefined reference to `glGenFramebuffers'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:71: undefined reference to `glGenTextures'
./obj/local/armeabi/objs/jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.o: In function `FrameBuffer::Init(int, int, unsigned int)':
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:30: undefined reference to `glBindFramebuffer'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:31: undefined reference to `glBindTexture'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:41: undefined reference to `glTexImage2D'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:45: undefined reference to `glTexParameteri'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:46: undefined reference to `glTexParameteri'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:49: undefined reference to `glTexParameteri'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:50: undefined reference to `glTexParameteri'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:57: undefined reference to `glFramebufferTexture2D'
D:\Scamera/jni/feature_mos/src/mosaic_renderer/FrameBuffer.cpp:65: undefined reference to `glBindFramebuffer'
collect2: ld returned 1 exit status
/cygdrive/c/android-ndk/build/core/build-binary.mk:369: recipe for target `obj/local/armeabi/libjni_mosaic.so' failed
make: *** [obj/local/armeabi/libjni_mosaic.so] Error 1

I can understand that some methods references are missing but I really don't know how to solve that.

I'd appreciate if anyone that already went through this process can help.

If you prefer to earn SO points, you can help there: http://stackoverflow.com/questions/13108603/ndk-error-trying-to-build-cyanogenmod-camera-application

Thank you!