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. When, Where and How to use Android Secure Credentials?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello,

I use a smartphone with Android 2.0.1.

When, Where and How to use Android Secure Credentials, please?

Regards.

-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 10.0.2 (Build 13)
Charset: ISO-8859-1

wsBVAwUBS8SCg1tvYf+/XdEWAQhE9AgAkyp2e+HZQV9U0/iD7bX1F7tklcylZmJ0
TtUMmaacFNOd6R/3EFPSSaMxgSgbDgYRiTFl7jCFX7lXpVJG8JtKOscuUS3xqxXd
FzJCFYxa4oXcpxOHkLbJ8YA/KZEgVJcnlWRRX6gTtrsF6rnjGoshtV+NaYWj8p/J
t4SegKfvEgNhfxNDAZB6oqW+8zvbgudA2b2ra1Ed2FC47V3QVhLwCHz5m05S/++8
A47UxtBBHJHmMfsOoU94r2RJOPVmDc/9lXSaMEjrIZU7fjl8APfw52wDUHqtpw9B
Q5wjTNgfL5QVMKIjuM+mZ6ai49hy9jBAHBFnkW/IVe0lgqpgV9DLXQ==
=aNtT
-----END PGP SIGNATURE-----

-- 

2. encoded polyline drawing in google map

Dear Friends,

I cant find any class/method to draw encoded polylines in google maps in
android. Can anyone please help me ?

Regards,
Ahsan, CSE-04
___________________________________________________
Md. Ahsanur Rashid
Graduate Student
Department of Computer Science
North Carolina State University
http://www4.ncsu.edu/~marashid/

-- 

3. N1 tidak bisa install PMessenge

4. ListView and Scroll

5. Conflict between seek bar and gesture effect

6. SYSV-IPC support not available in android

7. twitter and facebook intent : suggestion for the community