Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine

Go down 
2 posters
AuthorMessage
qidaozhilong2




Messages : 11
Date d'inscription : 2012-03-31

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSat Mar 31, 2012 1:36 pm

Hi, everyone.

I found this interesting particle system on irrlicht forum.
So i download "SPARK-1.5.5_SDK" and extract on my Android Eclipse Document, then add some sentences to Android.mk.
But when i compiled this particle part with irrlicht, some errors occur.
Like
"...
...SPK_System.cpp:62: undefined reference to '__cxa_bad_cast'
...
...SPK_Emitter.cpp:50: undefined reference to '__cxa_bad_cast'
...
...SPK_Modifier.cpp:51: undefined reference to '__cxa_bad_cast'
...
...SPK_Group.cpp:125: undefined reference to '__cxa_bad_cast'
...
...SPK_NormalEmitter.cpp:42: undefined reference to '__cxa_bad_cast'
"

Before that, i have tested other 3rd part(irrAI, irrBullet) on Irrlicht engine on Android, the renderer output is OK.
My only Changes on source code:
As renderer used irrlicht, so "SPK_GL_All.cpp", "SPK_SFML_All.cpp" are not included in $(libirrParticle_la_SOURCES)

By the way, i found all the compiling errors are "dynamic_cast operator" ERROR.

Please Help me.Thank you.
(Sorry, English is not my native language, maybe some expression is not good or correct.)

【Android.mk】:
LOCAL_PATH := $(call my-dir)
LOCAL_IRRPARTICLE_INCLUDES := \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include/Core \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include/Extensions/Emitters \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include/Extensions/Modifiers \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include/Extensions/Renderers \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include/Extensions/Zones \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include/RenderingAPIs/Irrlicht \
$(LOCAL_PATH)/irrlicht_3rd/irrParticle/include

libirrParticle_la_SOURCES := \
irrlicht_3rd/irrParticle/source/SPK_All.cpp \
irrlicht_3rd/irrParticle/source/SPK_IRR_ALL.cpp

...

########################## Five Module:IrrParticle ##########################
include $(CLEAR_VARS)
LOCAL_MODULE := irrlichtParticle
LOCAL_C_INCLUDES := $(LOCAL_IRRLICHT_INCLUDES) $(LOCAL_IRRPARTICLE_INCLUDES)
LOCAL_SRC_FILES := $(libirrParticle_la_SOURCES)
LOCAL_SHARED_LIBRARIES := libirrlicht
LOCAL_ARM_MODE := arm
LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -O3 -DANDROID_NDK -DDISABLE_IMPORTGL
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lGLESv2
include $(BUILD_SHARED_LIBRARY)
#####################################################################

...

########################## test Module3:IrrParticle ##########################
include $(CLEAR_VARS)
LOCAL_MODULE := irrParticleexample
LOCAL_C_INCLUDES := $(LOCAL_IRRLICHT_INCLUDES) $(LOCAL_IRRPARTICLE_INCLUDES) $(LOCAL_IRRPARTICLE_EXAMPLES_INCLUDES)
LOCAL_SRC_FILES := $(libirrParticle_examples_SOURCES)
LOCAL_SHARED_LIBRARIES := libirrlicht libirrlichtParticle
LOCAL_ARM_MODE := arm
LOCAL_CFLAGS := $(LOCAL_C_INCLUDES:%=-I%) -O3 -DANDROID_NDK -DDISABLE_IMPORTGL
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog -lGLESv2
include $(BUILD_SHARED_LIBRARY)
#####################################################################
Back to top Go down
Darktib
Committer
Darktib


Messages : 389
Date d'inscription : 2009-07-20
Localisation : A coté de Paris

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSat Mar 31, 2012 2:02 pm

Which compiler do you use ?
Normally, dynamic_cast should compile fine, and '__cxa_bad_cast' is a compiler defined function (because of the double underscore)
Back to top Go down
qidaozhilong2




Messages : 11
Date d'inscription : 2012-03-31

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSat Mar 31, 2012 2:30 pm

Android NDK compiler
Command:
$NDK/ndk-build

Actually, its "arm-linux-androideabi-4.4.3"

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Ndk_co11
Back to top Go down
Darktib
Committer
Darktib


Messages : 389
Date d'inscription : 2009-07-20
Localisation : A coté de Paris

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSun Apr 01, 2012 5:13 am

Found that Android NDK Compiler is a modified GCC.
With plain gcc it compiles (was tested on Linux and Windows), but here it seems that dynamic_cast of references is not supported by the compiler (dynamic_cast<const T*> works).

Change the dynamic_cast<const T&> to dynamic_cast<const T*>. Do not forget to change the code that follow the dynamic_cast to work with a pointer and not a reference!

PS: why did you call SPARK 'IrrlichtParticle' ?
Back to top Go down
qidaozhilong2




Messages : 11
Date d'inscription : 2012-03-31

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSun Apr 01, 2012 5:46 am

Darktib,

Hi, thanks for your apply.
I've found some useful informations from GOOGLE.
Now, compiled is OK, some changes is following:

Application.mk(before)
"
STLPORT_FORCE_REBUILD := true
APP_STL := stlport_static
"

Application.mk(after)
"
STLPORT_FORCE_REBUILD := true
APP_STL := gnustl_static
LOCAL_CPPFLAGS := -frtti
"

BTW, why did you call SPARK 'IrrlichtParticle' ?
Just a name, of course can be 'IrrlichtSPARK'.
Back to top Go down
qidaozhilong2




Messages : 11
Date d'inscription : 2012-03-31

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSun Apr 01, 2012 11:34 am

SPARK effort with irrlicht on my Android phone.
Too amazing.

Darktib, good job. But only 2 demos using irrlicht. Have you any plan on port other demos on irrlicht renderer?

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Pic10
Back to top Go down
Darktib
Committer
Darktib


Messages : 389
Date d'inscription : 2009-07-20
Localisation : A coté de Paris

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSun Apr 01, 2012 12:04 pm

That's look really cool! Good job for finding the solution!

For the moment I'm working on SPARK 2.0 with Juff, maybe we'll port some demos to Irrlicht (but I don't think all, because demos have to show OpenGL an SFML too; you can still adapt the SPARK logic part, that's not really hard Wink )
Back to top Go down
qidaozhilong2




Messages : 11
Date d'inscription : 2012-03-31

Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitimeSun Apr 01, 2012 12:11 pm

OK, i will spend some time on the I/Fs between IRRLICHT and SPARK.
I will try to port other demos on Irrlicht.

ps:This project is a GREAT one.
Back to top Go down
Sponsored content





Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Empty
PostSubject: Re: Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine   Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine Icon_minitime

Back to top Go down
 
Compiling ERRORS about '__cxa_bad_cast' on Android using Irrlicht Render Engine
Back to top 
Page 1 of 1
 Similar topics
-
» [SPARK2] Compiling Errors
» Compiling SPARK2 and DX9 causes bunch of errors
» Compiling SPARK 2 on Gentoo Linux
» SPARK2 Build errors
» SPARK2 libpugixml errors

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Questions (en)-
Jump to: