Hi all,
I'm building an open source 2D game engine called YoghurtGum (http://
code.google.com/p/yoghurtgum/), and I want to port it to Android.
However, I've run into a bit of a snag.
You see, in my engine, every object in a game is derived from
"Object", while actual scene objects are derived from "Entity" (which
has an x and y position). This is important because it allows to
create an array of Entity pointers that will loop over every in-game
object.
I'm trying to compile a simple test using the Android NDK:
class Base
{
public:
Base() { }
virtual ~Base();
}; // class Base
Base::~Base()
{
}
class Vehicle : public Base
{
public:
Vehicle() : Base() { }
~Vehicle();
}; // class Vehicle
Vehicle::~Vehicle()
{
}
class Car : public Vehicle
{
public:
Car() : Vehicle() { }
~Car();
}; // class Car
Car::~Car()
{
}
int main(int a_Data, char** argv)
{
Car* stupid = new Car();
return 0;
}
Here's the command I'm using to compile it:
/home/oem/android-ndk-r3-crystax/build/prebuilt/linux-x86/arm-
eabi-4.4.0/bin/arm-eabi-g++ -g -nostdlib -std=c++0x -Wall -Werror -O2 -
w -shared -fshort-enums -fno-builtin -I ../../YoghurtGum/src/GLES -
I ../../YoghurtGum/src -I /home/oem/android-ndk-r3-crystax/build/
platforms/android-5/arch-arm/usr/include -c src/Inheritance.cpp -o
intermediate/Inheritance.o
Here's my linker command:
/home/oem/android-ndk-r3-crystax/build/prebuilt/linux-x86/arm-
eabi-4.4.0/bin/arm-eabi-g++ -Wl,--entry=main -Wl,-rpath-link=/home/oem/
android-ndk-r3-crystax/build/platforms/android-5/arch-arm/usr/lib -Wl,-
rpath-link=/home/oem/android-ndk-r3-crystax/build/prebuilt/linux-x86/
arm-eabi-4.4.0/arm-eabi/lib -Wl,-dynamic-linker=/system/bin/linker -
Wl,-L/home/oem/android-ndk-r3-crystax/build/platforms/android-5/arch-
arm/usr/lib -Wl,-rpath=../../YoghurtGum/lib/GLES -nostdlib -lstdc++ -
lm -lc -lGLESv1_CM /home/oem/android-ndk-r3-crystax/build/platforms/
android-5/arch-arm/usr/lib/crtbegin_dynamic.o /home/oem/android-ndk-r3-
crystax/build/platforms/android-5/arch-arm/usr/lib/crtend_android.o
intermediate/Inheritance.o ../../YoghurtGum/bin/YoghurtGum.a -o bin/
Galaxians.android
And, unfortunately, these are my errors:
intermediate/Inheritance.o:(.rodata+0x38): undefined reference to
`vtable for __cxxabiv1::__si_class_type_info'
intermediate/Inheritance.o:(.rodata+0x50): undefined reference to
`vtable for __cxxabiv1::__si_class_type_info'
intermediate/Inheritance.o:(.rodata+0x64): undefined reference to
`vtable for __cxxabiv1::__class_type_info'
collect2: ld returned 1 exit status
make: *** [bin/Galaxians.android] Fout 1
Is this related to RTTI? If so, how can I enable RTTI for Android? I'm
already using the patched NDK which supposedly enables it.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to
andro...@googlegroups.com.
To unsubscribe from this group, send email to
android-ndk...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.