天天看點

error: exception handling disabled, use -fexceptions to enable

編譯錯誤如下:

java/android/tinyWRAP_wrap.cxx: In member function 'virtual int SwigDirector_DDebugCallback::OnDebugInfo(const char*)':
java/android/tinyWRAP_wrap.cxx:740:52: error: exception handling disabled, use -fexceptions to enable
       throw Swig::DirectorException(jenv, swigerror);
                                                    ^
Makefile:778: recipe for target 'java/android/libtinyWRAP_la-tinyWRAP_wrap.lo' failed      

怎麼辦?

CPPFLAGS=-fno-exceptions
改成
CPPFLAGS=-fexceptions      

或者

Android.mk
LOCAL_CPPFLAGS += -fexceptions
 
Application.mk
APP_CPPFLAGS  += -fexceptions      

繼續閱讀