Imagination PowerVR SDK Blog

Problems with compiling PVRScope example

pvrmonitor
pvrscope

#1

Hi all,



I got a problem with compiling PVRScope example on Android.



I create a PVRScopeExample in eclipse.



Then I type “ndk-build APP_ABI=armeabi”.



Output:


[armeabi] Compile++ thumb: OGLES2PVRScopeExample <= PVRScopeGraphAPI.cpp
[armeabi] Compile++ thumb: OGLES2PVRScopeExample <= OGLES2PVRScopeExample.cpp
[armeabi] Compile++ thumb: OGLES2PVRScopeExample <= PVRShell.cpp
[armeabi] Compile++ thumb: OGLES2PVRScopeExample <= PVRShellAPI.cpp
[armeabi] Compile++ thumb: OGLES2PVRScopeExample <= PVRShellOS.cpp
[armeabi] Compile thumb : android_native_app_glue <= android_native_app_glue.c
[armeabi] StaticLibrary : libandroid_native_app_glue.a
[armeabi] Compile++ thumb: ogles2tools <= PVRTPrint3DAPI.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTgles2Ext.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTTextureAPI.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTBackground.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTPFXParserAPI.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTPFXSemantics.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTShader.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTFixedPoint.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTMatrixF.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTMisc.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTTrans.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTVertex.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTModelPOD.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTDecompress.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTTriStrip.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTTexture.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTPrint3D.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTResourceFile.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTString.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTStringHash.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTPFXParser.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTShadowVol.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTVector.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTError.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTUnicode.cpp
[armeabi] Compile++ thumb: ogles2tools <= PVRTQuaternionF.cpp
[armeabi] StaticLibrary : libogles2tools.a
[armeabi] SharedLibrary : libOGLES2PVRScopeExample.so
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/PVRScopeGraphAPI.o: in function CPVRScopeGraph::APIRender(SPVRScopeAPIData*):/home/steve/Android_SDK/workspace/PVRScopeExample/jni/PVRScopeGraphAPI.cpp:219: error: undefined reference to 'CPVRScopeGraph::GetMaximumOfData(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::ReleaseView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:435: error: undefined reference to 'CPVRScopeGraph::~CPVRScopeGraph()'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:377: error: undefined reference to 'CPVRScopeGraph::CPVRScopeGraph()'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:382: error: undefined reference to 'CPVRScopeGraph::position(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:392: error: undefined reference to 'CPVRScopeGraph::GetCounterName(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:392: error: undefined reference to 'CPVRScopeGraph::GetCounterGroup(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:392: error: undefined reference to 'CPVRScopeGraph::IsCounterPercentage(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:393: error: undefined reference to 'CPVRScopeGraph::ShowCounter(unsigned int, bool)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:397: error: undefined reference to 'CPVRScopeGraph::SetActiveGroup(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:400: error: undefined reference to 'CPVRScopeGraph::ShowCounter(unsigned int, bool)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::InitView():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:403: error: undefined reference to 'CPVRScopeGraph::SetUpdateInterval(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:472: error: undefined reference to 'CPVRScopeGraph::IsCounterShown(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:472: error: undefined reference to 'CPVRScopeGraph::ShowCounter(unsigned int, bool)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:477: error: undefined reference to 'CPVRScopeGraph::SetActiveGroup(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:482: error: undefined reference to 'CPVRScopeGraph::SetActiveGroup(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:542: error: undefined reference to 'CPVRScopeGraph::GetCounterGroup(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:542: error: undefined reference to 'CPVRScopeGraph::GetCounterName(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:539: error: undefined reference to 'CPVRScopeGraph::IsCounterShown(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:540: error: undefined reference to 'CPVRScopeGraph::GetMaximum(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:541: error: undefined reference to 'CPVRScopeGraph::GetMaximumOfData(unsigned int)'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:542: error: undefined reference to 'CPVRScopeGraph::IsCounterPercentage(unsigned int) const'
/home/steve/Android_SDK/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/OGLES2PVRScopeExample//home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.o: in function OGLES2PVRScopeExample::RenderScene():/home/steve/Android_SDK/workspace/PVRScopeExample/jni/OGLES2PVRScopeExample.cpp:554: error: undefined reference to 'CPVRScopeGraph::Ping(unsigned int)'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libOGLES2PVRScopeExample.so] Error 1



I think there might be something wrong with my Android.mk

Here is my Android.mk:

LOCAL_PATH := /
ECLIPSE_PROJECT := $(realpath $(call my-dir)/..)/


ifeq ($(HOST_OS),windows)
LOCAL_PATH := $(realpath $(call my-dir)/..)
ECLIPSE_PROJECT :=
PVRSDKDIR := ../
$(info Please notice that for Windows we recommend to point PVRSDKDIR to ../ and copy the shell/, tools/ and builds/ directories from the add-on folder to your workspace/.)
endif

ifeq ($(PVRSDKDIR), )
$(error PVRSDKDIR needs to be defined as an environment variable pointing to the PowerVR SDK add-on directory.)
endif

include $(CLEAR_VARS)

LOCAL_MODULE := OGLES2PVRScopeExample

LOCAL_SRC_FILES :=
$(ECLIPSE_PROJECT)jni/PVRScopeGraphAPI.cpp
$(ECLIPSE_PROJECT)jni/OGLES2PVRScopeExample.cpp
$(PVRSDKDIR)/shell/PVRShell.cpp
$(PVRSDKDIR)/shell/API/KEGL/PVRShellAPI.cpp
$(PVRSDKDIR)/shell/OS/Android/PVRShellOS.cpp

LOCAL_C_INCLUDES := .
$(PVRSDKDIR)/builds/Include
$(PVRSDKDIR)/shell
$(PVRSDKDIR)/shell/API/KEGL
$(PVRSDKDIR)/shell/OS/Android
$(PVRSDKDIR)/tools
$(PVRSDKDIR)/tools/OGLES2

LOCAL_CFLAGS := -DBUILD_OGLES2

LOCAL_LDLIBS :=
-llog
-landroid
-lEGL
-lGLESv2
-ldl

LOCAL_STATIC_LIBRARIES :=
android_native_app_glue
ogles2tools
PVRScopeDeveloper



include $(BUILD_SHARED_LIBRARY)
include $(PVRSDKDIR)/tools/OGLES2/Build/Android/Android.mk
$(call import-module,android/native_app_glue)



Can you kindly help me?

Thanks

#2

Dear Uncle Steve,



The libraries provided with PVRMonitor are built using the r10 NDK release:

<a href=“http://dl.google.com/android/ndk/android-ndk64-r10-linux-x86_64.tar.bz2

”>dl.google.com/android/ndk/android-ndk64-r10-linux-x86_64.tar.bz2



I believe compatibility was broken for mips64 on newer NDK releases without adding extra compiler flags.



Until our next release which will use the latest NDK you can either:

  1. Use the r10 NDK linked above if you need MIPS64 binaries
  2. Remove MIPS64 from your build target





    Thanks,

    Paul

#3

Hi Pauls,



Thanks for your reply.

I solved with adding a link to libPVRScopeDeveloper.a:



LOCAL_PATH := /

ECLIPSE_PROJECT := $(realpath $(call my-dir)/…)/





ifeq ($(HOST_OS),windows)

LOCAL_PATH := $(realpath $(call my-dir)/…)

ECLIPSE_PROJECT :=

PVRSDKDIR := …/

$(info Please notice that for Windows we recommend to point PVRSDKDIR to …/ and copy the shell/, tools/ and builds/ directories from the add-on folder to your workspace/.)

endif



ifeq ($(PVRSDKDIR), )

$(error PVRSDKDIR needs to be defined as an environment variable pointing to the PowerVR SDK add-on directory.)

endif



include $(CLEAR_VARS)



LOCAL_MODULE := OGLES2PVRScopeExample



LOCAL_SRC_FILES :=

$(ECLIPSE_PROJECT)jni/PVRScopeGraph.cpp

$(ECLIPSE_PROJECT)jni/PVRScopeGraphAPI.cpp

$(ECLIPSE_PROJECT)jni/OGLES2PVRScopeExample.cpp

$(PVRSDKDIR)/shell/PVRShell.cpp

$(PVRSDKDIR)/shell/API/KEGL/PVRShellAPI.cpp

$(PVRSDKDIR)/shell/OS/Android/PVRShellOS.cpp



LOCAL_C_INCLUDES :=

$(ECLIPSE_PROJECT)jni/

$(PVRSDKDIR)/builds/Include

$(PVRSDKDIR)/shell

$(PVRSDKDIR)/shell/API/KEGL

$(PVRSDKDIR)/shell/OS/Android

$(PVRSDKDIR)/tools

$(PVRSDKDIR)/tools/OGLES2



LOCAL_CFLAGS := -DBUILD_OGLES2



LOCAL_LDLIBS :=

-llog

-landroid

-lEGL

-lGLESv2

-ldl

-L$(PVRSDKDIR)/builds/Android/armeabi/Lib -lPVRScopeDeveloper



LOCAL_STATIC_LIBRARIES :=

android_native_app_glue

ogles2tools

PVRScopeDeveloper







include $(BUILD_SHARED_LIBRARY)

include $(PVRSDKDIR)/tools/OGLES2/Build/Android/Android.mk

$(call import-module,android/native_app_glue)




Thanks,

Steve