Topic locked

ndk-build error in Image target

February 25, 2013 - 11:10pm #1

 

Compile++ arm    : ImageTargets <= ImageTargets.cpp
jni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':
jni/ImageTargets.cpp:428:45: error: 'TAJMAHALStride' was not declared in this scope
jni/ImageTargets.cpp:428:80: error: 'glVertexPointer' was not declared in this scope
jni/ImageTargets.cpp:429:46: error: 'TAJMAHALNumVerts' was not declared in this scope
 

ndk-build error in Image target

March 25, 2014 - 3:51am #27

Can Anyone Help me to declere targetSize ?

You can declare targetSize as a QCAR::Vec2F.

Note: it looks like you are copy-pasting some code from one sample into another (e.g. from VideoPlayback into ImageTargets, or something similar); this is perfectly legitimate, but before doing that I would recommend you are well familiar with C++ programming (e.g. variable declaration), and when copying code from one place to another, you need to make sure you are also copying the relevant variable declarations and everything else you need to bring something consistently.

Final note: you are posting on a thread which is not really relevant to your issue; please create a new thread in the future; this thread was already answered and the discussion ws over. By reopening this thread with a basic programming question you are simply creating confusion in the thread itself.

Thanks.

 

 

ndk-build error in Image target

March 25, 2014 - 3:05am #26

Hi,

I am New in Android ..i am showing following error during Ndk-Build in Cygwin for Image Target Native Sample

$ /cygdrive/c/Development/android-ndk-r9/ndk-build
Compile++ arm    : ImageTargetsNative <= ImageTargets.cpp
jni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':
jni/ImageTargets.cpp:372:34: error: 'targetSize' was not declared in this scope
/cygdrive/c/Development/android-ndk-r9/build/core/build-binary.mk:348: recipe for target 'obj/local/armeabi-v7a/objs/ImageTargetsNative/ImageTargets.o' failed
make: *** [obj/local/armeabi-v7a/objs/ImageTargetsNative/ImageTargets.o] Error 1
 
I don't Know how to declare 'targetSize'

  SampleUtils::scalePoseMatrix(targetSize.data[0],targetSize.data[1],1.0f,

               &modelViewMatrix.data[0]);
 
Above code is for ImageTarget.cpp..
 
Can Anyone Help me to declere targetSize ?
 
Thank You
 
 

ndk-build error in Image target

June 17, 2013 - 10:32pm #25

you're welcome

ndk-build error in Image target

June 17, 2013 - 5:10pm #24


AlessandroB wrote:

I would recommend to use ndk-build from the console (and avoid using the ndk-builder in Eclipse, as this kind of problems can emerge)

Thanks for responce AlessandroB,

You are totally right.

I changed codes that like  (myPackage name is com.arel.augmentedrealitytest)

Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_initApplicationNative 

to:

Java_com_arel_augmentedrealitytest_ImageTargets_initApplicationNative

(myPackage name is com.arel.augmentedrealitytest)

Cygwin shows
-------
$ ndk-build
Compile++ arm    : AugmentedRealityTest <= ImageTargets.cpp
SharedLibrary  : libAugmentedRealityTest.so
Install        : libAugmentedRealityTest.so => libs/armeabi/libAugmentedRealityTest.so
Install        : libQCAR.so => libs/armeabi/libQCAR.so
Compile++ arm    : AugmentedRealityTest <= ImageTargets.cpp
SharedLibrary  : libAugmentedRealityTest.so
Install        : libAugmentedRealityTest.so => libs/armeabi-v7a/libAugmentedRealityTest.so
Install        : libQCAR.so => libs/armeabi-v7a/libQCAR.so
------

and than got 

" Failed to initilaze QCAR". error.

So I realized to forget to add some permisition in manifest file.

and changed code in ImageTargets.cpp  

  "getTexture", "(I)Lcom/qualcomm/QCARSamples/ImageTargets/Texture;");

to 
        "getTexture", "(I)Lcom/arel/augmentedrealitytest/Texture;");
 

build ndk again

Cygwin shows
-------
$ ndk-build
Compile++ arm    : AugmentedRealityTest <= ImageTargets.cpp
SharedLibrary  : libAugmentedRealityTest.so
Install        : libAugmentedRealityTest.so => libs/armeabi/libAugmentedRealityTest.so
Install        : libQCAR.so => libs/armeabi/libQCAR.so
Compile++ arm    : AugmentedRealityTest <= ImageTargets.cpp
SharedLibrary  : libAugmentedRealityTest.so
Install        : libAugmentedRealityTest.so => libs/armeabi-v7a/libAugmentedRealityTest.so
Install        : libQCAR.so => libs/armeabi-v7a/libQCAR.so
-------

Got no errors in log Thanks alot :)

 

ndk-build error in Image target

June 14, 2013 - 11:32am #23

I would recommend to use ndk-build from the console (and avoid using the ndk-builder in Eclipse, as this kind of problems can emerge)

 

 

ndk-build error in Image target

June 14, 2013 - 11:28am #22

Thanks AlessandroB

I changed 

NATIVE_LIB_SAMPLE = "ImageTargets"; to NATIVE_LIB_SAMPLE = "AugmentedRealityTest"; 

and in android.mk changed LOCAL_MODULE := ImageTargets to  LOCAL_MODULE := AugmentedRealityTest

I create a ndk builder like a sample http://mobilepearls.com/labs/ndk-builder-in-eclipse/

now

Cygwin shows
 
$ ndk-build
Compile++ arm    : AugmentedRealityTest <= ImageTargets.cpp
Compile++ arm    : AugmentedRealityTest <= SampleUtils.cpp
Compile++ arm    : AugmentedRealityTest <= Texture.cpp
SharedLibrary  : libAugmentedRealityTest.so
Install        : libAugmentedRealityTest.so => libs/armeabi/libAugmentedRealityTest.so
Install        : libQCAR.so => libs/armeabi/libQCAR.so
Compile++ arm    : AugmentedRealityTest <= ImageTargets.cpp
Compile++ arm    : AugmentedRealityTest <= SampleUtils.cpp
Compile++ arm    : AugmentedRealityTest <= Texture.cpp
SharedLibrary  : libAugmentedRealityTest.so
Install        : libAugmentedRealityTest.so => libs/armeabi-v7a/libAugmentedRealityTest.so
Install        : libQCAR.so => libs/armeabi-v7a/libQCAR.so
 
but Eclipse is giving some error 
 
Errors occurred during the build.
Errors running builder 'Integrated External Tool Builder' on project 'AugmentedRealityTest'.
Exception occurred executing command line.
Cannot run program "C:\Development\Android\android-ndk-r8e\ndk-build" (in directory "C:\Development\Android\vuforia-sdk-android-2-0-31\samples\AugmentedRealityTest"): CreateProcess error=193, %1 is not a valid Win32 application
Exception occurred executing command line.
Cannot run program "C:\Development\Android\android-ndk-r8e\ndk-build" (in directory "C:\Development\Android\vuforia-sdk-android-2-0-31\samples\AugmentedRealityTest"): CreateProcess error=193, %1 is not a valid Win32 application
Errors running builder 'Integrated External Tool Builder' on project 'AugmentedRealityTest'.
Exception occurred executing command line.
Cannot run program "C:\Development\Android\android-ndk-r8e\ndk-build" (in directory "C:\Development\Android\vuforia-sdk-android-2-0-31\samples\AugmentedRealityTest"): CreateProcess error=193, %1 is not a valid Win32 application
Exception occurred executing command line.
Cannot run program "C:\Development\Android\android-ndk-r8e\ndk-build" (in directory "C:\Development\Android\vuforia-sdk-android-2-0-31\samples\AugmentedRealityTest"): CreateProcess error=193, %1 is not a valid Win32 application
 
 

ndk-build error in Image target

June 10, 2013 - 2:49am #21

Hi, the error in the image indicates that your Java code is unable to resolve the link to the C++ code;

this probably happens because you created your project by copying the code from ImageTargets and renaming the project, but probably you forgot to update certain references to the right name of your native module; for instance, the LOCAL_MODULE ( e.g. LOCAL_MODULE := ImageTargets) in your Android.mk should be the same as the one that appears in the Java code (see loadLibrary() and NATIVE_LIB_SAMPLE = "ImageTargets" in ImageTargets.java);

also, the C++ function names should reflect the name of the Java classes, as per JNI specification.

Have you checked this article, which explains these basic issues ?

https://developer.vuforia.com/forum/faq/android-how-do-i-fix-my-compile-or-runtime-errors

 

ndk-build error in Image target

June 9, 2013 - 8:48pm #20

AlessandroB wrote:

Hi, from your stack trace I see you're using glVerteCoordPointer, but glVerteCoordPointer is a function specific of OpenGL ES 1.1;

take care that you are not using OpenGL ES 1.1 and 2.0 simultaneously, as this may be causing your issue.

Maybe read again and double-check all the steps in the tutorial, here it is:

https://developer.vuforia.com/forum/faq/android-how-do-i-replace-teapot

 

Thanks your feedback AlessandroB

I actually did replace teapon on Image Target sample. But now I am trying to do in my project which have  these errors . weird

Edit: I changed 

USE_OPENGL_ES_1_1 := false 

to 

USE_OPENGL_ES_1_1 := true

and Now I 've got some errors when my application enter the ImageTarget activity.

Cygwin shows
-------
$ ndk-build
Install        : libImageTargets.so => libs/armeabi/libImageTargets.so
Install        : libQCAR.so => libs/armeabi/libQCAR.so
Install        : libImageTargets.so => libs/armeabi-v7a/libImageTargets.so
Install        : libQCAR.so => libs/armeabi-v7a/libQCAR.so
-------
 
and my logcat :
 
 

 

AttachmentSize
Image icon error.jpg352.64 KB

ndk-build error in Image target

June 9, 2013 - 8:55am #19

Hi, from your stack trace I see you're using glVerteCoordPointer, but glVerteCoordPointer is a function specific of OpenGL ES 1.1;

take care that you are not using OpenGL ES 1.1 and 2.0 simultaneously, as this may be causing your issue.

Maybe read again and double-check all the steps in the tutorial, here it is:

https://developer.vuforia.com/forum/faq/android-how-do-i-replace-teapot

 

ndk-build error in Image target

June 9, 2013 - 12:46am #18

Hi guys I tried to all steps but still getting error like this

Compile++ arm    : ImageTargets <= ImageTargets.cpp
jni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv*, jobject)':
jni/ImageTargets.cpp:381:59: error: 'glTexCoordPointer' was not declared in thisscope
jni/ImageTargets.cpp: In function 'void Java_com_qualcomm_QCARSamples_ImageTarges_ImageTargetsRenderer_initRendering(JNIEnv*, jobject)':
jni/ImageTargets.cpp:678:64: error: 'cubeMeshVertexShader' was not declared in this scope
jni/ImageTargets.cpp:679:61: error: 'cubeFragmentShader' was not declared in this scope
/cygdrive/c/Development/Android/android-ndk-r8e/build/core/build-binary.mk:272:recipe for target `obj/local/armeabi/objs/ImageTargets/ImageTargets.o' failed
make: *** [obj/local/armeabi/objs/ImageTargets/ImageTargets.o] Error 1
 
 

 

ndk-build error in Image target

February 28, 2013 - 12:11am #17

Glad to hear that. You're welcome.

ndk-build error in Image target

February 27, 2013 - 11:27pm #16

Hi Alessadro B:

my project is running successfully....

thank you very much for your support.

regards

bitupatel

ndk-build error in Image target

February 26, 2013 - 6:44am #15

Got it, thanks.

I was able to render the Tajmahal model; these are the code changes I made (starting from a fresh ImageTargets sample):

  • add the include statement:
#include "TAJMAHALOBJ.h"
  • increased kObjectScale to 100.f;
  • in the renderFrame() function, I modified the rendering code as follows (since your model has no indices, no tex-coords and no normals):
glUseProgram(shaderProgramID);
         

        glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &TAJMAHALOBJVerts[0]);
       /*
        glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &teapotNormals[0]);
        glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                              (const GLvoid*) &teapotTexCoords[0]);
*/

        
        glEnableVertexAttribArray(vertexHandle);
        //glEnableVertexAttribArray(normalHandle);
        //glEnableVertexAttribArray(textureCoordHandle);
        
        glActiveTexture(GL_TEXTURE0);
        glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
        glUniform1i(texSampler2DHandle, 0);
        glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE,
                           (GLfloat*)&modelViewProjection.data[0] );

        /*
        glDrawElements(GL_TRIANGLES, NUM_TEAPOT_OBJECT_INDEX, GL_UNSIGNED_SHORT,
                       (const GLvoid*) &teapotIndices[0]);
                       */

        glDrawArrays(GL_TRIANGLES, 0, TAJMAHALOBJNumVerts);

 

Can you try the same ?

 

ndk-build error in Image target

February 26, 2013 - 6:15am #14

hello, 

i'hv sent u msg plz check it...

 

ndk-build error in Image target

February 26, 2013 - 5:59am #13

sry its very long file...so it is not possible to copy paste if any other option to upload file and then i can send it....

 

ndk-build error in Image target

February 26, 2013 - 5:44am #12

I've sent you a message, just reply to that (check your email)

ndk-build error in Image target

February 26, 2013 - 5:41am #11

how can i send u .h file i dnt have ur email id plz give me ur id.....

 

ndk-build error in Image target

February 26, 2013 - 5:40am #10

Just click on my name and then on the Send a Message button

ndk-build error in Image target

February 26, 2013 - 4:43am #9

ya give me your email id plz...

ndk-build error in Image target

February 26, 2013 - 2:32am #8

Can you PM me the header file (.h) of your 3D model ?

 

ndk-build error in Image target

February 26, 2013 - 1:29am #7

i have done this:

kObjectScale=100.f

but no result....plz help me .....

ndk-build error in Image target

February 26, 2013 - 12:38am #6

Have you adjusted the kObjectScale (see in ImageTargets.cpp, global variables) ?

Sometimes it is just that the model is too small and you might need to increase that number to something big (e.g. 100).

 

ndk-build error in Image target

February 26, 2013 - 12:36am #5

Thanks.....but now ndk-build successfully but now shown when i run the project...object is not display.

wht should i do???

ndk-build error in Image target

February 26, 2013 - 12:18am #4

The OpenGL version is specified in the Android.mk file (in the /jni directory); look for this line:

USE_OPENGL_ES_1_1 := false

if you want to use OpenGL ES 1.1 (instead of 2.0), just set the value of that variable to true

You may also want to have a look at this article:

https://developer.vuforia.com/resources/dev-guide/replacing-teapot

HTH.

 

ndk-build error in Image target

February 26, 2013 - 12:07am #3

how to check opengl version i m new for this....sry for my bad english...

ndk-build error in Image target

February 25, 2013 - 11:48pm #2

Hi, you probably forgot to include the header file (.h) containing the TAJMAHALStride and TAJMAHALNumVerts definitions.

Also, glVertexpointer is compatible with OpenGL 1.1, while if you are using OpenGL 2.0 you should use glVertexAttribPointer().

Topic locked