static member data issue in arm-eabi-ld

by simon » Fri, 16 Jan 2009 02:14:26 GMT


Sponsored Links
 i all,

i'm trying to compile simple native application under Android platform
and got problem with linker (looks like linker or linker scripts bug)

my simple program:

class C
{
static int m;

public:
static void f() { m = 0; }
};

int main(int, char**)
{
C::f();
return 0;
}

compilation commands:

arm-eabi-gcc -c -I/home/simon/workspace/mydroid/system/core/include -I/
home/simon/workspace/mydroid/hardware/libhardware/include -I/home/
simon/workspace/mydroid/hardware/ril/include -I/home/simon/workspace/
mydroid/dalvik/libnativehelper/include/nativehelper -I/home/simon/
workspace/mydroid/frameworks/base/include -I/home/simon/workspace/
mydroid/frameworks/base/libs/audioflinger -I/home/simon/workspace/
mydroid/external/skia/include -I/home/simon/workspace/mydroid/out/
target/product/generic/obj/include -I/home/simon/workspace/mydroid/
bionic/libc/arch-arm/include -I/home/simon/workspace/mydroid/bionic/
libc/include -I/home/simon/workspace/mydroid/bionic/libstdc++/include -
I/home/simon/workspace/mydroid/bionic/libc/kernel/common -I/home/simon/
workspace/mydroid/bionic/libc/kernel/arch-arm -I/home/simon/workspace/
mydroid/bionic/libm/include -I/home/simon/workspace/mydroid/bionic/
libm/include/arch/arm -I/home/simon/workspace/mydroid/bionic/
libthread_db/include -I/home/simon/workspace/mydroid/bionic/libm/arm -
I/home/simon/workspace/mydroid/bionic/libm -I/home/simon/workspace/
mydroid/out/target/product/generic/obj/SHARED_LIBRARIES/
libm_intermediates -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -
D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DSK_DEBUG -DDEBUG -
march=armv5te -mtune=xscale -msoft-float -mthumb-interwork -fno-
threadsafe-statics -fpic -fno-exceptions -ffunction-sections -funwind-
tables -fstack-protector-all -fmessage-length=0 main2.cpp

arm-eabi-gcc -o mt -I/home/simon/workspace/mydroid/system/core/include
-I/home/simon/workspace/mydroid/hardware/libhardware/include -I/home/
simon/workspace/mydroid/hardware/ril/include -I/home/simon/workspace/
mydroid/dalvik/libnativehelper/include/nativehelper -I/home/simon/
workspace/mydroid/frameworks/base/include -I/home/simon/workspace/
mydroid/frameworks/base/libs/audioflinger -I/home/simon/workspace/
mydroid/external/skia/include -I/home/simon/workspace/mydroid/out/
target/product/generic/obj/include -I/home/simon/workspace/mydroid/
bionic/libc/arch-arm/include -I/home/simon/workspace/mydroid/bionic/
libc/include -I/home/simon/workspace/mydroid/bionic/libstdc++/include -
I/home/simon/workspace/mydroid/bionic/libc/kernel/common -I/home/simon/
workspace/mydroid/bionic/libc/kernel/arch-arm -I/home/simon/workspace/
mydroid/bionic/libm/include -I/home/simon/workspace/mydroid/bionic/
libm/include/arch/arm -I/home/simon/workspace/mydroid/bionic/
libthread_db/include -I/home/simon/workspace/mydroid/bionic/libm/arm -
I/home/simon/workspace/mydroid/bionic/libm -I/home/simon/workspace/
mydroid/out/target/product/generic/obj/SHARED_LIBRARIES/
libm_intermediates -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -
D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -DANDROID -DSK_DEBUG -DDEBUG -
march=armv5te -mtune=xscale -msoft-float -mthumb-interwork -fno-
threadsafe-statics -fpic -fno-exceptions -ffunction-sections -funwind-
tables -fstack-protector-all -fmessage-length=0 -Bdynamic -Wl,-T,/home/
simon/workspace/mydroid/build/core/armelf.x -Wl,-dynamic-linker,/
system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,--no-
undefined -Wl,-rpath



static member data issue in arm-eabi-ld

by Michael MacDonald » Fri, 16 Jan 2009 03:44:15 GMT


 his is a problem with your c++ program, not with android.

m is declared but not defined.

You need to add

int c::m;

to your source file.

simon wrote:


--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


static member data issue in arm-eabi-ld

by Andrew Stadler » Fri, 16 Jan 2009 06:12:20 GMT


 orry to keep repeating this, but native development is *not*
currently supported by the SDK. This mailing list is for discussion
of application development using the SDK. You may want to try
android-platform or android-discuss.

See <http://source.android.com/discuss> for more information.

Thanks,
Andy




On Thu, Jan 15, 2009 at 8:25 AM, simon <semen.sema...@gmail.com> wrote:

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. because of /data/app 's Permission problem ,so i can't install any apk in /data/app.

when using pc emulator,the Permission  of  /data/app as fellow: (so I
can install apk files successfuly)

 ls -l
-rwxrwxrwx root     root      1745016 2009-02-23 03:05 busybox
drwxrwx--x system   system            2008-12-22 07:37 location

drwxrwx--x system   system            2008-12-22 07:37 app

drwxrwx--t system   misc              2009-02-25 01:20 misc
drwxrwx--x shell    shell             2009-02-25 01:20 local
drwxrwx--x system   system            2009-02-25 01:20 data
drwxrwx--x system   system            2009-02-25 01:20 app-private
drwx------ root     root              2009-02-25 01:20 property
drwxrwx--x system   system            2009-02-25 01:20 dalvik-cache
drwxrwxrwx system   system            2009-02-25 01:21 anr
drwxrwxr-x system   system            2009-02-25 01:21 system
drwxrwx--- root     root              2009-02-25 01:20 lost+found

but, on a Development board, ,the Permission  of  /data/app as fellow:
(so I can't install any apk files in /data/app )

# ls -l
drwxrwxr-x system   system            2000-01-01 00:03 system
drwxrwxrwx system   system            2000-01-01 00:03 anr
drwxrwx--x system   system            2000-01-01 00:02 dalvik-cache
drwxrwx--x wifi     system            2000-01-01 00:02 wlan0
drwx------ root     root              2000-01-01 00:02 property
drwxrwx--x system   system            2000-01-01 00:02 app-private
drwxrwx--x system   system            2000-01-01 00:02 data
drwxrwx--x shell    shell             2000-01-01 00:02 local
drwxrwx--t system   misc              2000-01-01 00:02 misc

drwxr-xr-x graphics graphics          2009-02-20 13:38 app

drwxrwx--- root     root              2000-01-01 00:02 lost+found


Is any one can tell me that why the  Permission  changed .

because the /data/app  owner and group are "graphics ", so I can't
install any
apk in the foolder /data/app.



--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Android on a Zii ZMS-05 processor.

Might be of interest to people not at MWC.

http://www.youtube.com/watch?v=TDu9bKB_I50

Phil.


--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Issue while installing ADT plugin for eclipce

4. Connecting to different Wifi SSID?

5. help to start simulator that built by myself

6. Notification of an app start

7. New Web Proxy List - View Restricted Content with web proxy