Log in or register to post comments

USE_OPENGL_ES_1_1, Eclipse, and JNI

March 2, 2013 - 10:28am #1

With the ImageTargets sample application, I tried using OpenGL ES 1.1 by setting USE_OPENGL_ES_1_1 to true in jni/Android.mk and uncommenting and changing the corresponding line in AndroidManifest.xml (<uses-feature android:glEsVersion="0x00010001" />). After converting the project so that it has a C++ perspective and associating ndk-build and the proper include directories, I could successfully run the application on my Android device.

However, the problem is that once I open up jni/ImageTargets.cpp, I get several errors from Eclipse, all from places where OpenGL ES 2.0 code would execute, the first one being:

Description Resource Path Location Type
Symbol 'vertexHandle' could not be resolved ImageTargets.cpp /ImageTargets/jni line 402 Semantic Error
Sure enough, vertexHandle is defined at the top of the file inside the "#ifdef USE_OPENGL_ES_2_0" block. Because USE_OPENGL_ES_2_0 is not defined (per Android.mk), the code should be able to compile successfully, and ndk-build does not report any problems. So it seems that Eclipse reports the problems and when I run the project, Eclipse says, "Your project contains error(s), please fix them before running your application."
 
The best work-around I've found so far is to just delete or comment out those lines (that should not be causing problems because USE_OPENGL_ES_2_0 is not supposed to be defined)... Is there a better way to deal with this problem? Did I miss a setting in Eclipse that should solve this?

USE_OPENGL_ES_1_1, Eclipse, and JNI

March 8, 2013 - 10:17pm #4

Great! Thanks for sharing it.

USE_OPENGL_ES_1_1, Eclipse, and JNI

March 8, 2013 - 6:34pm #3

I've found a solution: go to the project properties -> C/C++ Build -> Discovery Options -> Check "Automate discovery of paths and symbols"

USE_OPENGL_ES_1_1, Eclipse, and JNI

March 3, 2013 - 6:38am #2

Hi, setting up Eclipse with C++ perspecive can be tricky; probably here Eclipse is not able to correctly pickup those preprocessor directives (i.e. the "#ifdef" definitions);

maybe have a look at some Eclipse-specific forums; here is one about preprocessor directives:

http://stackoverflow.com/questions/3747147/how-to-specify-a-preprocessor-directive-in-eclipse

 

 

Log in or register to post comments