Hello. I’m trying to use PVRScope for the native C program (command line program) on Android.
(My device is Odroid-XU with Android 4.2.2)
I have tried to compile the example code of PVRScopeStats, included in PVRScope’s user manual.
And, I found some example for Android NDK in
http://imgtec.eetrend.com/sites/imgtec.eetrend.com/files/download/201403/1765-3054-tuxingfenxiandroid.pdf
Thus now trying to use Android NDK for compling of the example.
(In Windows(cygwin), using the Android NDK ver. r10e)
(Application.mk contains only APP_ABI := armeabi-v7a)
Below is my Android.mk for ndk-build command.
[hr]
LOCAL_PATH := /home/admin/project/jni
include $(CLEAR_VARS)
LOCAL_MODULE:= PVRScope
LOCAL_SRC_FILES := /home/admin/PVRScopeDeveloper/Linux_armv7/libPVRScopeDeveloper.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := example
LOCAL_SRC_FILES := example.c
LOCAL_C_INCLUDES := /home/admin/PVRScopeDeveloper/Linux_armv7/
LOCAL_STATIC_LIBRARIES := PVRScope
LOCAL_LDFLAGS += -Wl,–no-undefined
LOCAL_CPPFLAGS := -std=c99 -Wall
include $(BUILD_EXECUTABLE)
[hr]
With these settings, ndk-build shows error messages below.
[hr]
$ ndk-build
[armeabi-v7a] Compile thumb : example <= example.c
C:/cygwin/home/admin/project/jni/example.c:21:13: error: unknown type name 'SPVRScopeImplData’
bool PSInit(SPVRScopeImplData **ppsPVRScopeData, SPVRScopeCounterDef ppsCounters, SPVRScopeCounterReading const psReading, unsigned int const pnCount)
^
C:/cygwin/home/admin/project/jni/example.c:21:50: error: unknown type name 'SPVRScopeCounterDef’
bool PSInit(SPVRScopeImplData **ppsPVRScopeData, SPVRScopeCounterDef ppsCounters, SPVRScopeCounterReading const psReading, unsigned int const pnCount)
^
C:/cygwin/home/admin/project/jni/example.c:21:85: error: unknown type name 'SPVRScopeCounterReading’
bool PSInit(SPVRScopeImplData **ppsPVRScopeData, SPVRScopeCounterDef ppsCounters, SPVRScopeCounterReading const psReading, unsigned int const pnCount)
^
C:/cygwin/home/admin/project/jni/example.c: In function ‘main’:
C:/cygwin/home/admin/project/jni/example.c:45:1: error: unknown type name 'SPVRScopeImplData’
SPVRScopeImplData *psData;
^
C:/cygwin/home/admin/project/jni/example.c:47:1: error: unknown type name 'SPVRScopeCounterDef’
SPVRScopeCounterDef *psCounters;
^
C:/cygwin/home/admin/project/jni/example.c:52:1: error: unknown type name 'SPVRScopeCounterReading’
SPVRScopeCounterReading sReading;
^
C:/cygwin/home/admin/project/jni/example.c:64:37: error: request for member ‘nGroup’ in something not a structure or union
printf(" Group %d %s", psCounters[i].nGroup, psCounters[i].pszName);
^
C:/cygwin/home/admin/project/jni/example.c:64:59: error: request for member ‘pszName’ in something not a structure or union
printf(" Group %d %s", psCounters[i].nGroup, psCounters[i].pszName);
^
C:/cygwin/home/admin/project/jni/example.c:77:1: warning: passing argument 1 of ‘PVRScopeSetGroup’ from incompatible pointer type [enabled by default]
PVRScopeSetGroup(psData, uActiveGroupSelect); bActiveGroupChanged = false;
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:219:6: note: expected ‘struct SPVRScopeImplData * const’ but argument is of type 'int *'
void PVRScopeSetGroup(
^
C:/cygwin/home/admin/project/jni/example.c:83:1: warning: passing argument 1 of ‘PVRScopeReadCounters’ from incompatible pointer type [enabled by default]
PVRScopeReadCounters(psData, NULL);
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:209:5: note: expected ‘struct SPVRScopeImplData * const’ but argument is of type 'int *'
int PVRScopeReadCounters(
^
C:/cygwin/home/admin/project/jni/example.c:90:1: warning: passing argument 1 of ‘PVRScopeReadCounters’ from incompatible pointer type [enabled by default]
if(PVRScopeReadCounters(psData, &sReading))
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:209:5: note: expected ‘struct SPVRScopeImplData * const’ but argument is of type 'int *'
int PVRScopeReadCounters(
^
C:/cygwin/home/admin/project/jni/example.c:90:1: warning: passing argument 2 of ‘PVRScopeReadCounters’ from incompatible pointer type [enabled by default]
if(PVRScopeReadCounters(psData, &sReading))
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:209:5: note: expected ‘struct SPVRScopeCounterReading * const’ but argument is of type 'int *'
int PVRScopeReadCounters(
^
C:/cygwin/home/admin/project/jni/example.c:94:16: error: request for member ‘nValueCnt’ in something not a structure or union
if(i < sReading.nValueCnt) {
^
C:/cygwin/home/admin/project/jni/example.c:96:25: error: request for member ‘pszName’ in something not a structure or union
if (strcmp(psCounters[i].pszName, “GPU task load: 3D core”) == 0) {
^
C:/cygwin/home/admin/project/jni/example.c:97:34: error: request for member ‘pszName’ in something not a structure or union
printf("%s : %f%", psCounters[i].pszName,
^
C:/cygwin/home/admin/project/jni/example.c:98:9: error: request for member ‘pfValueBuf’ in something not a structure or union
sReading.pfValueBuf[i]);
^
C:/cygwin/home/admin/project/jni/example.c:101:30: error: request for member ‘pszName’ in something not a structure or union
else if (strcmp(psCounters[i].pszName, “GPU task load: TA core”) == 0)
^
C:/cygwin/home/admin/project/jni/example.c:103:34: error: request for member ‘pszName’ in something not a structure or union
printf("%s : %f%", psCounters[i].pszName,
^
C:/cygwin/home/admin/project/jni/example.c:104:9: error: request for member ‘pfValueBuf’ in something not a structure or union
sReading.pfValueBuf[i]);
^
C:/cygwin/home/admin/project/jni/example.c:114:1: warning: passing argument 1 of ‘PVRScopeDeInitialise’ from incompatible pointer type [enabled by default]
PVRScopeDeInitialise(&psData, &psCounters, &sReading);
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:148:6: note: expected ‘struct SPVRScopeImplData **’ but argument is of type 'int **'
void PVRScopeDeInitialise(
^
C:/cygwin/home/admin/project/jni/example.c:114:1: warning: passing argument 2 of ‘PVRScopeDeInitialise’ from incompatible pointer type [enabled by default]
PVRScopeDeInitialise(&psData, &psCounters, &sReading);
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:148:6: note: expected ‘struct SPVRScopeCounterDef **’ but argument is of type 'int **'
void PVRScopeDeInitialise(
^
C:/cygwin/home/admin/project/jni/example.c:114:1: warning: passing argument 3 of ‘PVRScopeDeInitialise’ from incompatible pointer type [enabled by default]
PVRScopeDeInitialise(&psData, &psCounters, &sReading);
^
In file included from C:/cygwin/home/admin/project/jni/example.c:19:0:
C:/cygwin/home/admin/PVRScopeDeveloper/Linux_armv7/PVRScopeStats.h:148:6: note: expected ‘struct SPVRScopeCounterReading * const’ but argument is of type 'int *'
void PVRScopeDeInitialise(
^
[hr]
It seems that the compiler could not recognized the static library(.a file) of PVRScope.
(I have tried other ABIs, but it does not work.)
Please give me some advice.
Any advice will help me.
Thank you for your reading.