您的位置:首页 > 运维架构 > Linux

(OK) 编译cBPM-android—CentOS 7—NDK8—androideabi-4.7—API14—3版

2016-03-31 21:11 429 查看
宿主机:CentOS 7 + android-ndk-r8e-linux-x86_64.tar.bz2 + arm_linux-androideabi-4.7 + API-14

手机:MB526 + Android 4.4.4 + armv7

[root@localhost android-on-linux]# wget -c https://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
-------------- Build: Debug Win32 in Criteria.Libraries.bOS (compiler: GNU ARM GCC Compiler For Android)---------------

步骤(问题)1:

/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory

[root@localhost cBPM-android]# ls /usr/include/gnu/stubs

stubs-64.h stubs.h

[root@localhost cBPM-android]#

解决方法: yum install glibc-devel.i686

步骤(问题)2:

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/stlport/limits.h:30:43: error: #include nested too deeply

解决方法: stlport/stlport/limits.h:27: #if defined (_STLP_HAS_INCLUDE_NEXT) 改为 #if !defined (_STLP_HAS_INCLUDE_NEXT)

步骤(问题)3:

-fno-exceptions

解决方法: -fexceptions 开启异常,

不用 Android自带的 libstlport.so,

使用/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a/libstlport_static.a

Linker Settings: -Wl,-dn -lstlport_static -Wl,-dy

步骤(问题)4:

String/bOSStringUtils.cpp:17:21: error: 'toupper' was not declared in this scope

解决方法: 在String/bOSStringUtils.cpp开头 #include "ctype.h"

步骤(问题)5:

Idioma/ItemInterface.cpp:41:30: error: 'isdigit' was not declared in this scope

解决方法: 在Idioma/ItemInterface.cpp开头 #include "ctype.h"

步骤(问题)6:

/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lxerces-c-3.1

解决方法:
http://permalink.gmane.org/gmane.text.xml.xerces-c.user/3834
步骤(问题)7:

+++++++++++++编译libiconv-1.14 (静态库)

[root@localhost libiconv-1.14]# pwd

/opt/cBPM-android/libiconv-1.14

[root@localhost libiconv-1.14]# make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r8e"

export SYSROOT="$NDK_ROOT/platforms/android-14/arch-arm"

export CFLAGS="-g --pipe --sysroot=$SYSROOT -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include-fixed -I$NDK_ROOT/platforms/android-14/arch-arm/usr/include"

export CPPFLAGS="$CFLAGS"

export CXXFLAGS="$CFLAGS"

export LDFLAGS="--sysroot=$SYSROOT -L$SYSROOT/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/cBPM-android/criteria-lin/lib -lstlport_static -lgcc -lc"

export CPATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin"

export CPP="$CPATH/arm-linux-androideabi-cpp"

export CXX="$CPATH/arm-linux-androideabi-g++"

export CC="$CPATH/arm-linux-androideabi-gcc"

export LD="$CPATH/arm-linux-androideabi-ld"

export AR="$CPATH/arm-linux-androideabi-ar"

[root@localhost libiconv-1.14]# gl_cv_header_working_stdint_h=yes ./configure --host=arm-linux-androideabi --enable-static --disable-shared

[root@localhost libiconv-1.14]# make -j5

[root@localhost libiconv-1.14]# find . -name libiconv.a

[root@localhost libiconv-1.14]# cp ./lib/.libs/libiconv.a /opt/cBPM-android/criteria-lin/lib

至此,成功编译 libiconv-1.14 静态库

-----------------如果遇到错误,参考下面内容

错误:configure: error: /bin/sh build-aux/config.sub arm-linux-androideabi failed

//You might need a newer config.sub and config.guess, 2010-05-20 or later.

//You can obtain the newest version of config.guess and config.sub from the ‘config’ project at http://savannah.gnu.org/. The commands to fetch them are

$ wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'

$ wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

或者:

[root@localhost libiconv-1.14]# locate config.guess

/opt/gcc-4.9.0/config.guess

[root@localhost libiconv-1.14]# cp /opt/gcc-4.9.0/config.guess /opt/gcc-4.9.0/config.sub build-aux/

[root@localhost libiconv-1.14]# cp /opt/gcc-4.9.0/config.guess /opt/gcc-4.9.0/config.sub libcharset/build-aux/

//[root@localhost libiconv-1.14]# gl_cv_header_working_stdint_h=yes ./configure --host=arm-linux-androideabi

[root@localhost libiconv-1.14]# gl_cv_header_working_stdint_h=yes ./configure --host=arm-linux-androideabi --enable-static --disable-shared

[root@localhost libiconv-1.14]# make -j5

[root@localhost libiconv-1.14]# find . -name libiconv.a

./lib/.libs/libiconv.a

//复制库文件(arm)

[root@localhost libiconv-1.14]# cp ./lib/.libs/libiconv.a /opt/cBPM-android/criteria-lin/lib

[root@localhost libiconv-1.14]# cp ./lib/.libs/libiconv.so* /opt/cBPM-android/criteria-lin/lib

[root@localhost libiconv-1.14]# cp /usr/lib64/libWorkflowEngineD.so /opt/cBPM-android/criteria-lin/lib

[root@localhost libiconv-1.14]# cp /usr/lib64/libLibraries.so /opt/cBPM-android/criteria-lin/lib

+++++++++++++编译Criteria.Tools.Executor错误

/opt/cBPM-android/criteria-lin/lib/libxerces-c.a(IconvTransService.o):IconvTransService.cpp:function xercesc_3_1::IconvLCPTranscoder::calcRequiredSize(char const*, xercesc_3_1::MemoryManager*): error: undefined reference to '__ctype_get_mb_cur_max'

解决方法:+++++++++++++ 在上面基础上,编译libiconv (静态库)

這似乎是NDK的BUG,在stdlib.h內有宣告出__ctype_get_mb_cur_max函數,但是卻沒有去實作它。如果出現這個問題,不建議直接修改NDK,要到libiconv目錄下,修改「libcharset/lib」目錄裡的「localcharset.c」檔案,在檔案最下面加上以下程式碼即可。

[root@localhost libiconv-1.14]# gedit /opt/cBPM-android/libiconv-1.14/libcharset/lib/localcharset.c

size_t __ctype_get_mb_cur_max(void){

return 1;

}

保存,重新编译libiconv (静态库)

[root@localhost libiconv-1.14]# nm ./lib/.libs/libiconv.a |grep ctype_get_mb_cur_max

U __ctype_get_mb_cur_max

0000060c T __ctype_get_mb_cur_max

//如果您指定了 -A 选项,则 nm 命令只报告与该文件有关的或者库或者对象名。

[root@localhost libiconv-1.14]# nm -A ./lib/.libs/libiconv.a|grep ctype_get_mb_cur_max

./lib/.libs/libiconv.a:iconv.o: U __ctype_get_mb_cur_max

./lib/.libs/libiconv.a:localcharset.o:0000060c T __ctype_get_mb_cur_max

[root@localhost libiconv-1.14]#

[root@localhost criteria-lin]# nm -A lib/lib* |grep ctype_get_mb_cur_max

nm: lib/libc.so:无符号

lib/libiconv.a:iconv.o: U __ctype_get_mb_cur_max

lib/libiconv.a:localcharset.o:0000060c T __ctype_get_mb_cur_max

lib/libiconv.so: U __ctype_get_mb_cur_max

lib/libiconv.so.2: U __ctype_get_mb_cur_max

lib/libiconv.so.2.5.1: U __ctype_get_mb_cur_max

nm: lib/libsqlite.so:无符号

nm: lib/libstdc++.so:无符号

lib/libxerces-c-3.1.so: U __ctype_get_mb_cur_max

lib/libxerces-c.a:IconvTransService.o: U __ctype_get_mb_cur_max

所以,编译Criteria.Tools.Executor时,需要 静态链接 /opt/cBPM-android/criteria-lin/lib/libiconv.a

+++++++++++++

+++++++++++++编译xerces-c-3.1.2(动态库)—CentOS 7— android-ndk

export XERCES="/opt/cBPM-android/xerces-c-3.1.2/"

export NDK="/opt/android-on-linux/android-ndk-r8e/"

export SYSROOT="$NDK/platforms/android-14/arch-arm"

export CC="$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc"

export CXX="$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++"

export CFLAGS="--sysroot=$SYSROOT"

export LDFLAGS="--sysroot=$SYSROOT -nostdlib -L$NDK/sources/cxx-stl/stlport/libs/armeabi-v7a -L$SYSROOT/usr/lib -L/opt/cBPM-android/criteria-lin/lib -liconv -lstdc++ -lstlport -lc"

export CPPFLAGS="-fPIC -I$NDK/sources/cxx-stl/stlport/stlport -I$NDK/platforms/android-14/arch-arm/usr/include -I$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/include -I$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include-fixed
-I$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include -I$XERCES/src/xercesc/xinclude -I$XERCES/tests/src/xinclude -I$XERCES/tests/src/xinclude/tests/xinclude"

// -nostdlib -Xlinker -R$SYSROOT/usr/lib $SYSROOT/usr/lib/crtbegin_static.o $SYSROOT/usr/lib/crtend_android.o

// ls /opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a

// libstlport_shared.so libstlport.so libstlport_static.a thumb

[root@localhost xerces-c-3.1.2]# ./configure --host=arm-linux-androideabi --enable-static --disable-shared --enable-transcoder-iconv

错误:configure: error: Xerces cannot function without a transcoder

解决方法如下:

//编译静态库

[root@localhost xerces-c-3.1.2]# ac_cv_func_iconv_open=yes ac_cv_func_iconv_close=yes ac_cv_func_mblen=yes ac_cv_func_wcstombs=yes ac_cv_func_mbstowcs=yes ac_cv_func_iconv=yes ./configure --host=arm-linux-androideabi --enable-static --disable-shared --enable-transcoder-iconv

[root@localhost xerces-c-3.1.2]# make -j5

//编译动态库

[root@localhost xerces-c-3.1.2]# gl_cv_header_working_stdint_h=yes ac_cv_func_iconv_open=yes ac_cv_func_iconv_close=yes ac_cv_func_mblen=yes ac_cv_func_wcstombs=yes ac_cv_func_mbstowcs=yes ac_cv_func_iconv=yes ./configure --host=arm-linux-androideabi --enable-transcoder-iconv

[root@localhost xerces-c-3.1.2]# make -j5

错误及解决方法:

错误:

xercesc/util/PlatformUtils.cpp:713:4: error: #error No timing support is configured for this platform.

stricmp.c:37:3: error: #error Need implementation of stricmp compatibility function

strnicmp.c:37:3: error: #error Need implementation of strnicmp compatibility function

解决方法,在 config.h 加下面一行

#define HAVE_GETTIMEOFDAY 1

#define HAVE_STRCASECMP 1

#define HAVE_STRNCASECMP 1

错误:

towupper.h conflicting declaration of C function 'int towupper(int)'

解决方法

towlower.h、towupper.h注释如下:

//extern int towlower(int wc);

//extern int towupper(int wc);

错误:

arm-linux-androideabi-g++: error: crtbegin_so.o: No such file or directory

arm-linux-androideabi-g++: error: crtend_so.o: No such file or directory

原因是ld找不到 crtbegin_so.o 和 crteng_so.o,

解决方法,在项目源码下面建立软连接

ln -s /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_so.o src

ln -s /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_so.o src

//成功编译动态库

[root@localhost xerces-c-3.1.2]# find . -name libxerces-c-3.1.so

./src/.libs/libxerces-c-3.1.so

//复制库文件(arm)

[root@localhost xerces-c-3.1.2]# cp ./src/.libs/libxerces-c-3.1.so /opt/cBPM-android/criteria-lin/lib

步骤(问题)8:

+++++++++++++ 在上面基础上,编译xerces-c (静态库)

编译xerces-c (静态库)—CentOS 7— android-ndk

[root@localhost xerces-c-3.1.2]# pwd

/opt/cBPM-android/xerces-c-3.1.2

[root@localhost xerces-c-3.1.2]# make clean

export XERCES="/opt/cBPM-android/xerces-c-3.1.2/"

export NDK_ROOT="/opt/android-on-linux/android-ndk-r8e"

export SYSROOT="$NDK_ROOT/platforms/android-14/arch-arm"

export CFLAGS="-g --sysroot=$SYSROOT --pipe -I$NDK_ROOT/sources/cxx-stl/stlport/stlport -I$NDK_ROOT/platforms/android-14/arch-arm/usr/include -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/include -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include-fixed
-I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include -I/opt/cBPM-android/libiconv-1.14/include"

export CPPFLAGS="$CFLAGS"

export CXXFLAGS="$CFLAGS"

export LDFLAGS="-L$NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/cBPM-android/criteria-lin/lib -static -lstlport_static -liconv -lgcc -lc"

export CPATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin"

export CPP="$CPATH/arm-linux-androideabi-cpp"

export CXX="$CPATH/arm-linux-androideabi-g++"

export CC="$CPATH/arm-linux-androideabi-gcc"

export LD="$CPATH/arm-linux-androideabi-ld"

export AR="$CPATH/arm-linux-androideabi-ar"

-liconv

--sysroot=$SYSROOT

------------------使用这条命令

[root@localhost xerces-c-3.1.2]# ./configure --host="arm-linux-eabi" --enable-static --disable-shared --enable-transcoder-iconv

出现错误

configure: error: Xerces cannot function without a transcoder

解决方法

[root@localhost xerces-c-3.1.2]# grep HAVE_ICONV_CLOSE -R .

./config.h.in:#undef HAVE_ICONV_CLOSE

[root@localhost libiconv-1.14]# pwd

/opt/cBPM-android/libiconv-1.14

[root@localhost libiconv-1.14]# cp include/iconv.h ../xerces-c-3.1.2/src/

------------------然后,使用这条命令

[root@localhost xerces-c-3.1.2]# ac_cv_func_iconv_open=yes ac_cv_func_iconv_close=yes ac_cv_func_mblen=yes ac_cv_func_wcstombs=yes ac_cv_func_mbstowcs=yes ac_cv_func_iconv=yes ./configure --host="arm-linux-eabi" --enable-static --disable-shared --enable-transcoder-iconv
--with-iconv=/opt/cBPM-android/libiconv-1.14

------------------

[root@localhost xerces-c-3.1.2]# make -j5

[root@localhost xerces-c-3.1.2]# cp ./src/.libs/libxerces-c.a /opt/cBPM-android/criteria-lin/lib

至此,成功编译 xerces-c-3.1.2 静态库

-----------------如果遇到错误,参考下面内容

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/include

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/stlport

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/gabi++/include

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi

-----------------------

[root@localhost lib]# cd /opt/android-on-linux/android-ndk-r10d/

[root@localhost android-ndk-r10d]# ls ndk-build

ndk-build

[root@localhost android-ndk-r10d]# export PATH=$PATH:/opt/android-on-linux/android-ndk-r10d/

[root@localhost android-ndk-r10d]# cd /opt/cBPM-android/commandergenius-sdl_android/project/jni/xerces

[root@localhost xerces]# pwd

/opt/cBPM-android/commandergenius-sdl_android/project/jni/xerces

[root@localhost xerces]# ndk-build

find: ‘/opt/cBPM-android/commandergenius-sdl_android/project/jni/../jni/application//src’: 没有那个文件或目录

Android NDK: WARNING:/opt/cBPM-android/commandergenius-sdl_android/project/jni/../jni/application/Android.mk:application: non-system libraries in linker flags: -ltremor

Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES

Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the

Android NDK: current module

[armeabi] SharedLibrary : libapplication.so

/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ltremor

collect2: error: ld returned 1 exit status

make: *** [/opt/cBPM-android/commandergenius-sdl_android/project/obj/local/armeabi/libapplication.so] Error 1

[root@localhost xerces]# ls /opt/cBPM-android/commandergenius-sdl_android/project/obj/local/armeabi/

libogg.a libsdl-1.2.so libsdl_native_helpers.so libtremor.a objs

[root@localhost xerces]# cp /opt/cBPM-android/commandergenius-sdl_android/project/obj/local/armeabi/libtremor.a /opt/android-on-linux/android-ndk-r10d/platforms/android-21/arch-arm/usr/lib/

-----------------------

// -nostdlib -Xlinker -R$SYSROOT/usr/lib $SYSROOT/usr/lib/crtbegin_static.o $SYSROOT/usr/lib/crtend_android.o

// ls /opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a

// libstlport_shared.so libstlport.so libstlport_static.a thumb

[root@localhost xerces-c-3.1.2]# ./configure --host=arm-linux-androideabi --enable-static --disable-shared --enable-transcoder-iconv

错误:configure: error: Xerces cannot function without a transcoder

解决方法如下:

//编译静态库

[root@localhost xerces-c-3.1.2]# ac_cv_func_iconv_open=yes ac_cv_func_iconv_close=yes ac_cv_func_mblen=yes ac_cv_func_wcstombs=yes ac_cv_func_mbstowcs=yes ac_cv_func_iconv=yes ./configure --host=arm-linux-androideabi --enable-static --disable-shared --enable-transcoder-iconv

[root@localhost xerces-c-3.1.2]# make -j5

错误:

xercesc/util/PlatformUtils.cpp:713:4: error: #error No timing support is configured for this platform. You must configure it.

解决方法,在 config.h 加下面一行

#define HAVE_GETTIMEOFDAY 1

#define HAVE_STRCASECMP 1

#define HAVE_STRNCASECMP 1

//成功编译静态库

[root@localhost xerces-c-3.1.2]# find . -name libxerces-c.a

./src/.libs/libxerces-c.a

//复制库文件(arm)

[root@localhost xerces-c-3.1.2]# cp ./src/.libs/libxerces-c.a /opt/cBPM-android/criteria-lin/lib

+++++++++++++编译Criteria.Tools.Executor错误

xercesc/util/XMLAbstractDoubleFloat.cpp:430: error: undefined reference to 'localeconv'

解决方法:+++++++++++++ 在上面基础上,编译xerces-c (静态库)

[root@localhost xerces-c-3.1.2]# pwd

/opt/cBPM-android/xerces-c-3.1.2

[root@localhost xerces-c-3.1.2]# find . -name XMLAbstractDoubleFloat.cpp

./src/xercesc/util/XMLAbstractDoubleFloat.cpp

[root@localhost xerces-c-3.1.2]# gedit ./src/xercesc/util/XMLAbstractDoubleFloat.cpp

// lconv* lc = localeconv();

// char delimiter = *lc->decimal_point;

char delimiter = '.'; //把localeconv()调用给绕过去了

保存,重新编译xerces-c (静态库)

+++++++++++++

步骤(问题)9:

+++++++++++++编译Criteria.Tools.Executor错误

/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lmysqlclient

解决方法: 使用 SQLite 替换 MySQL, CodeBlocks中,Linker Settings:mysqlclient 替换为 sqlite

********---------------------------********

[root@localhost criteria-lin]# gedit ./src/Criteria/Criteria.Libraries.bOS/SQL/bOSSQLConnectionManager.cpp



#include "bOSmySQLConnection.h"

#include "bOSmySQLConnectionData.h"

using namespace bOS::SQL::mySQL;

#ifdef _USE_SQLITE3_

#include "bOSSQLiteConnection.h"

#include "bOSSQLiteConnectionData.h"

using namespace bOS::SQL::SQLite3;

#endif

修改为

#ifdef _USE_MYSQL_

#include "bOSmySQLConnection.h"

#include "bOSmySQLConnectionData.h"

using namespace bOS::SQL::mySQL;

#endif

#ifdef _USE_SQLITE3_

#include "bOSSQLiteConnection.h"

#include "bOSSQLiteConnectionData.h"

using namespace bOS::SQL::SQLite3;

#endif

********---------------------------********

[root@localhost criteria-lin]# gedit ./include/bOS/bOSSQLConnectionManager.h



enum DataBaseType

{

ODBC_INTERFACE,

SQLITE3,

MYSQL

};

修改为

enum DataBaseType

{

CONN,

MYSQL,

ODBC_INTERFACE,

SQLITE3,

FILESYSTEM

};

********---------------------------********

所有 和 MYSQL 相关 代码,使用如下:

#ifdef _MYSQL_

...

#endif

实际只涉及一个文件: ./src/Criteria/Criteria.Libraries.bOS/SQL/bOSSQLConnectionManager.cpp

比较彻底的方法:

[root@localhost criteria-lin]# mv ./include/bOS/mySQL ./include/bOS/mySQL-not-use

[root@localhost criteria-lin]# mv ./src/Criteria/Criteria.Libraries.bOS/SQL/mySQL/ ./src/Criteria/Criteria.Libraries.bOS/SQL/mySQL-not-use

另外,src/Criteria/Criteria.Libraries.bOS/Libraries.bOS.cbp,中删除如下内容:

<Unit filename="SQL/mySQL/bOSmySQLConnection.cpp" />

<Unit filename="SQL/mySQL/bOSmySQLConnection.h" />

<Unit filename="SQL/mySQL/bOSmySQLConnectionData.cpp" />

<Unit filename="SQL/mySQL/bOSmySQLConnectionData.h" />

<Unit filename="SQL/mySQL/bOSmySQLResultSet.cpp" />

<Unit filename="SQL/mySQL/bOSmySQLResultSet.h" />

<Unit filename="SQL/mySQL/bOSmySQLResultSetField.cpp" />

<Unit filename="SQL/mySQL/bOSmySQLResultSetField.h" />

<Unit filename="SQL/mySQL/bOSmySQLResultSetMetaData.cpp" />

<Unit filename="SQL/mySQL/bOSmySQLResultSetMetaData.h" />

步骤(问题)10:

********---------------------------编译参数 设置********codeblocks 全局参数 设置:

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【Other options】



【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【#defines】



【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Linker Settings】->【Link libraries】



【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Search directories】->【Compiler】



【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Search directories】->【Linker】



【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Toolchain executable】->【compiler Installation directory】

/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/

arm-linux-androideabi-gcc

arm-linux-androideabi-g++

arm-linux-androideabi-g++

arm-linux-androideabi-ar

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Build options】->【处理器数】4

********---------------------------******** 全局参数 设置:权宜之计,实现 静态库的编译:

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Other Settings】->【Advanced options】->【Commands】->【Link object files to dynamic library】



$linker -shared $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs

修改为

$lib_linker -r -s $static_output $link_objects

********---------------------------******** 全局参数 设置:权宜之计,实现 链接对象顺序的正确,否则,编译Criteria.Tools.Executor出错

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Other Settings】->【Advanced options】->【Commands】->【Link object files to console executable】



$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs

修改为

$linker $libdirs -o $exe_output /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o $link_objects $link_resobjects $link_options $libs /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

主要是下面两个文件的位置:

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

********---------------------------********

codeblocks 局部参数 设置: Criteria.Libraries.bOS

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【Other options】

-W

-O0

-g3

-c

-fmessage-length=0

-fexceptions

默认情况下,GNU工具链编译过程中,控制台输出的一行信息是不换行的,这样,当输出信息过长时(如编译错误时的信息),会导致你无法看到完整的输出信息,加入-fmessage-length=0后,输出信息会根据控制台的宽度自动换行,这样就能看全输出信息了。

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【#defines】

_USE_SQLITE3_

SQLITE_OS_UNIX

WIN32

_DEBUG

_WINDOWS

_USRDLL

_CODEMANAGER_TRACE_ON_

BOS_EXPORTS

CODEMANAGER_EXPORTS

ANDROID

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Search directories】->【Compiler】

/opt/cBPM-android/criteria-lin/include/bOS/

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/stlport

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/include

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Pre/post build steps】->【Post-build steps】

cp /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/bOS/libLibraries.a /opt/cBPM-android/criteria-lin/lib/

右健单击【Criteria.Libraries.bOS】,选择【Properties】,设置见图。

********---------------------------********

codeblocks 局部参数 设置: Criteria.WorkflowEngine

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【Other options】

-W

-O0

-g3

-c

-fmessage-length=0

-fexceptions

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【#defines】

WIN32

_DEBUG

_WINDOWS

_USRDLL

ENGINE_EXPORTS

WAPI_EXPORTS

_CODEMANAGER_TRACE_ON_

_USE_SQLITE3_

BOS_EXPORTS

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Search directories】->【Compiler】

/opt/cBPM-android/criteria-lin/include/WorkflowEngine

/opt/cBPM-android/criteria-lin/include/bOS/

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/stlport

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/include

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Pre/post build steps】->【Post-build steps】

cp /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/WorkflowEngine/libWorkflowEngineD.a /opt/cBPM-android/criteria-lin/lib/

右健单击【Criteria.WorkflowEngine】,选择【Properties】,设置见图。

********---------------------------********

codeblocks 局部参数 设置: Criteria.Tools.Executor

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【Other options】

-W

-O0

-g3

-c

-fmessage-length=0

-fexceptions

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Compiler Settings】->【#defines】

WIN32

_DEBUG

_CONSOLE

_CODEMANAGER_TRACE_ON_

BOS_EXPORTS

ENGINE_EXPORTS

顺序超级重要)》》》》》》》》》》(顺序超级重要)《《《《《《《《《《《《《

codeblocks 局部参数 设置: Criteria.Tools.Executor

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Linker Settings】->【Link libraries】

WorkflowEngineD

Libraries

sqlite

xerces-c

iconv

stlport_static

m

gcc

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Linker Settings】->【Other linker options】

-static

-nostdlib

-Wl,-dy /opt/cBPM-android/criteria-lin/lib/libdl.so /opt/cBPM-android/criteria-lin/lib/libc.so -Wl,-dn

-Wl,-dy /opt/cBPM-android/criteria-lin/lib/libdl.so -Wl,-dn

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Search directories】->【Compiler】

/opt/cBPM-android/criteria-lin/include/bOS/

/opt/cBPM-android/criteria-lin/include/WorkflowEngine

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/include

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/stlport

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Search directories】->【Linker】

/opt/cBPM-android/criteria-lin/lib

/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/

/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/armv7-a/ //libgcc.a

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Pre/post build steps】->【Post-build steps】

cp /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /opt/cBPM-android/criteria-lin/lib/

右健单击【Criteria.WorkflowEngine】,选择【Properties】,设置见图。

至此,编译Criteria.Tools.Executor成功,具体见 步骤(问题)11:

+++++++++++++编译Criteria.Tools.Executor出错,参考下面内容

error: undefined reference to 'dlopen'

添加链接选项:

-Wl,-dy -ldl -Wl,-dn

-Wl,-dy -lgcc -lc -lstlport_static -lstdc++ -ldl -Wl,-dn

+++++++++++++编译Criteria.Tools.Executor错误:

src/main.cpp:155: error: undefined reference to '__cxa_end_cleanup'

最后一行: return 0;

修改为: exit(0);

----------------------------

arm-linux-androideabi-g++

-L/opt/cBPM-android/criteria-lin/lib -L/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/ -L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/armv7-a/

-o /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer

/opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/src/main.o

-static -nostdlib -Wl,-v -Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn -lgcc -lsqlite -lxerces-c -lLibraries -lWorkflowEngineD

$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs

$linker $libdirs -o $exe_output $link_objects $link_resobjects crtbegin_static.o $link_options $libs crtend_android.o

arm-eabi-ld $(LDFLAGS) crtbegin_static.o $(OBJECTS) $(LIBS) crtend_android.o

-Wl,-v -Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn

+++++++++++++编译Criteria.Tools.Executor错误

CodeManager/CodeItem.cpp:96: error: undefined reference to 'std::ostrstream::str()'

正因为 ostrstream 调用str()后需要自己清除存储空间的不便,才有了后来的ostringstream,对这个问题的改进,我们不必须再负责清除存储空间啦.

+++++++++++++编译Criteria.Tools.Executor错误

bionic/libc/bionic/libc_logging.cpp:165: error: undefined reference to '__aeabi_uldivmod'

使用手机上的libc.so,不使用静态库

[root@localhost mb526-all-lib]# cp /opt/cBPM-android/mb526-all-lib/libc.so /opt/cBPM-android/criteria-lin/lib/

+++++++++++++编译Criteria.Tools.Executor错误 困扰2天的错误

WAPI/WAPI.cpp:72: error: undefined reference to 'bOS::XML::XMLHelper::initialize()'

WAPI/WAPI.cpp:137: error: undefined reference to 'bOS::XML::XMLHelper::terminate()'

WAPI/WAPIProcess.cpp:37: error: undefined reference to 'bOS::XML::Data::XMLObject::getXMLString(unsigned int)'

WAPI/WAPIProcess.cpp:64: error: undefined reference to 'bOS::XML::Data::XMLObject::getXMLString(unsigned int)'

WAPI/WAPIProcess.cpp:92: error: undefined reference to 'bOS::XML::Data::XMLObject::getXMLString(unsigned int)'

...

engine/Workflow.cpp:175: error: undefined reference to 'bOS::Collections::Collection::clear()'

engine/Workflow.cpp:488: error: undefined reference to 'bOS::Collections::Collection::clear()'

engine/Workflow.cpp:672: error: undefined reference to 'bOS::Collections::Collection::clear()'

ExternalEvent/ManagedEventElement.cpp:73: error: undefined reference to 'bOS::XML::XMLAttribute::XMLAttribute()'

ExternalEvent/ManagedEventElement.cpp:74: error: undefined reference to 'bOS::XML::XMLAttribute::setName(char const*)'

ExternalEvent/ManagedEventElement.cpp:79: error: undefined reference to 'bOS::XML::XMLAttribute::setValue(char const*)'

ExternalEvent/ManagedEventElement.cpp:82: error: undefined reference to 'bOS::XML::XMLAttribute::setValue(char const*)'

ExternalEvent/ManagedEventElement.cpp:85: error: undefined reference to 'bOS::XML::XMLAttribute::setValue(char const*)'

collect2: error: ld returned 1 exit status

Process terminated with status 1 (0 minute(s), 1 second(s))

313 error(s), 0 warning(s) (0 minute(s), 1 second(s))

-----------------------------------

解决方法:(顺序超级重要)(之前順序:Libraries、WorkflowEngineD)》》》》》(顺序超级重要)《《《《《

codeblocks 局部参数 设置: Criteria.Tools.Executor

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Linker Settings】->【Link libraries】

WorkflowEngineD

Libraries

sqlite

xerces-c

iconv

stlport_static

m

gcc

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Linker Settings】->【Other linker options】

-static

-nostdlib

-Wl,-dy -ldl -lc -Wl,-dn

+++++++++++++编译Criteria.Tools.Executor错误(不用看)

Utils/bOSUniqueID.cpp:22: error: undefined reference to 'srand'

Utils/bOSUniqueID.cpp:38: error: undefined reference to 'rand'

解决方法:

[root@localhost android-ndk-r10d]# gedit platforms/android-21/arch-arm/usr/include/stdlib.h

[root@localhost android-ndk-r10d]# gedit platforms/android-14/arch-arm/usr/include/stdlib.h

srand is defined as inline in: android-19/arch-arm/usr/include/stdlib.h

將定义 放到 android-21/arch-arm/usr/include/stdlib.h

+++++++++++++编译Criteria.Tools.Executor错误

xercesc/util/XMLAbstractDoubleFloat.cpp:430: error: undefined reference to 'localeconv'

參考<<编译xerces-c (静态库)>>

+++++++++++++编译Criteria.Tools.Executor错误

xercesc/util/Transcoders/Iconv/IconvTransService.cpp:238: error: undefined reference to '__ctype_get_mb_cur_max'

需要 静态链接 /opt/cBPM-android/criteria-lin/lib/libiconv.a

步骤(问题)11:

+++++++++++++编译Criteria.Tools.Executor————成功

arm-linux-androideabi-g++ -W -O0 -g3 -c -fmessage-length=0 -fexceptions -DWIN32 -D_DEBUG -D_CONSOLE -D_CODEMANAGER_TRACE_ON_ -DBOS_EXPORTS -DENGINE_EXPORTS -I/opt/cBPM-android/criteria-lin/include/bOS -I/opt/cBPM-android/criteria-lin/include/WorkflowEngine
-I/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/include -I/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/stlport -c src/main.cpp -o /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/src/main.o

arm-linux-androideabi-g++ -L/opt/cBPM-android/criteria-lin/lib -L/opt/android-on-linux/android-ndk-r10d/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/android-on-linux/android-ndk-r10d/platforms/android-16/arch-arm/usr/lib/ -L/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.6/armv7-a/
-o /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/src/main.o -static
-nostdlib -Wl,-dy /opt/cBPM-android/criteria-lin/lib/libdl.so /opt/cBPM-android/criteria-lin/lib/libc.so -Wl,-dn -lWorkflowEngineD -lLibraries -lsqlite -lxerces-c -liconv -lstlport_static -lm -lgcc /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

Output file is /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer with size 21.75 MB

Running target post-build steps

cp /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /opt/cBPM-android/criteria-lin/lib/

Process terminated with status 0 (0 minute(s), 46 second(s))

0 error(s), 305 warning(s) (0 minute(s), 46 second(s))

步骤(问题)12:

+++++++++++++编译Criteria.Tools.Executor————成功———测试

[root@localhost lib]# pwd

/opt/cBPM-android/criteria-lin/lib

[root@localhost lib]# ll executer

-rwxr-xr-x. 1 root root 22830836 9月 25 07:49 executer

[root@localhost lib]# adb root

bash: adb: 未找到命令...

相似命令是: 'gdb'

--------------------------------

[root@localhost platform-tools]# pwd

/opt/android-on-linux/android-sdk-linux/platform-tools

[root@localhost platform-tools]# ls adb

adb

[root@localhost platform-tools]#

将 PATH=$PATH:/opt/android-on-linux/android-sdk-linux/platform-tools 添加到 /root/.bashrc 最后。

[root@localhost lib]# adb root

bash: /opt/android-on-linux/android-sdk-linux/platform-tools/adb: /lib/ld-linux.so.2: bad ELF interpreter: 没有那个文件或目录

[root@localhost lib]# yum install glibc.i686

[root@localhost lib]# adb root

adb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

[root@localhost lib]# yum install libstdc++.so.6

--------------------------------

[root@localhost lib]# adb root

[root@localhost lib]# adb push executer /data/data/criteria

3352 KB/s (22209660 bytes in 6.469s)

[root@localhost lib]# adb root

[root@localhost lib]# adb shell

root@mb526:/ # export WF_HOME=/data/data/criteria; export CRITERIA_HOME=/data/data/criteria

root@mb526:/ # cd data/data/criteria/

root@mb526:/data/data/criteria # ./executer TestNotePad

/system/bin/sh: ./executer: No such file or directory

这是因为系统的动态链接器与executer程序中动态链接器的名字或路径不对,执行如下命令:

[root@localhost lib]# pwd

/opt/cBPM-android/criteria-lin/lib

[root@localhost lib]# readelf -l executer

Elf 文件类型为 EXEC (可执行文件)

入口点 0xb138

共有 8 个程序头,开始于偏移量52

程序头:

Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align

PHDR 0x000034 0x00008034 0x00008034 0x00100 0x00100 R 0x4

INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1

[正在请求程序解释器:/usr/lib/libc.so.1]

LOAD 0x000000 0x00008000 0x00008000 0x526848 0x526848 R E 0x1000

LOAD 0x526ec8 0x0052fec8 0x0052fec8 0x33154 0x509b0 RW 0x1000

DYNAMIC 0x535cd8 0x0053ecd8 0x0053ecd8 0x000e8 0x000e8 RW 0x4

GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0

EXIDX 0x466770 0x0046e770 0x0046e770 0x19900 0x19900 R 0x4

GNU_RELRO 0x526ec8 0x0052fec8 0x0052fec8 0x11138 0x11138 RW 0x8

Section to Segment mapping:

段节...

00

01 .interp

02 .interp .dynsym .dynstr .hash .rel.dyn .rel.plt .plt .text .note.android.ident .ARM.extab .ARM.exidx .rodata

03 .data.rel.ro.local .fini_array .init_array .preinit_array .data.rel.ro .dynamic .got .data .bss

04 .dynamic

05

06 .ARM.exidx

07 .data.rel.ro.local .fini_array .init_array .preinit_array .data.rel.ro .dynamic .got

[root@localhost lib]# objdump -x executer|grep NEEDED

NEEDED libdl.so

NEEDED libc.so

[root@localhost lib]#

[root@localhost lib]# pwd

/opt/cBPM-android/criteria-lin/lib

[root@localhost lib]# adb push executer /data/data/criteria

3352 KB/s (22209660 bytes in 6.469s)

[root@localhost lib]# adb root

[root@localhost lib]# adb shell

root@mb526:/ # cd data/data/criteria/

root@mb526:/data/data/criteria # ./executer TestNotePad

/system/bin/sh: ./executer: No such file or directory

root@mb526:/data/data/criteria # mount -o remount,rw /

root@mb526:/data/data/criteria # mkdir -p /usr/lib

root@mb526:/data/data/criteria # cp /system/lib/libc.so /system/lib/libdl.so /usr/lib/

root@mb526:/data/data/criteria # ./executer

/system/bin/sh: ./executer: No such file or directory

1|root@mb526:/data/data/criteria # ln -s /usr/lib/libc.so /usr/lib/libc.so.1

1|root@mb526:/data/data/criteria # ln -s /usr/lib/libdl.so /usr/lib/libdl.so.1

root@mb526:/data/data/criteria # ./executer

/system/bin/sh: ./executer: Permission denied

root@mb526:/data/data/criteria # ll /usr/lib/lib*

-rw-r--r-- root root 306604 2015-09-22 08:16 libc.so

lrwxrwxrwx root root 2015-09-22 08:17 libc.so.1 -> /usr/lib/libc.so

-rw-r--r-- root root 9348 2015-09-22 08:16 libdl.so

lrwxrwxrwx root root 2015-09-22 08:17 libdl.so.1 -> /usr/lib/libdl.so

root@mb526:/data/data/criteria # chmod 777 /usr/lib/lib*so

root@mb526:/data/data/criteria # ./executer TestNotePad

Illegal instruction

//这个错误表明我们的程序执行了不正确的指令。一般这种情况是因为我们编译起编译出了较高版本的ARM指令造成的。

//API level 21,NDK 10,arm_linux-androideabi-4.9

//我的手机,Android 4.4.4,ARMv7,---> API level 19,NDK 9,arm_linux-androideabi-4.6

//所以库文件路径: /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/include

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/

// 上面过程 重新 做一遍

//API level 19,NDK 9,arm_linux-androideabi-4.6,链接失败

//API level 15,NDK 9,arm_linux-androideabi-4.8,Illegal instruction

//API level 19,NDK 10,arm_linux-androideabi-4.6,链接失败

//API level 19,NDK 10,arm_linux-androideabi-4.8,Illegal instruction

//API level 16,NDK 10,arm_linux-androideabi-4.8,Illegal instruction

//API level 16,NDK 10,arm_linux-androideabi-4.6,error: cannot mix -static with dynamic object

//API level 14,NDK 8,arm_linux-androideabi-4.7,成功

------------------------------------------------------------------------------------------

下面是在手机上运行移植成功的cBPM-android

------------------------------------------------------------------------------------------

[root@localhost lib]# pwd

/opt/cBPM-android/criteria-lin/lib

[root@localhost lib]# adb push executer /data/data/criteria

3352 KB/s (22209660 bytes in 6.469s)

[root@localhost lib]# adb root

[root@localhost lib]# adb shell

root@mb526:/ # cd data/data/criteria/

root@mb526:/data/data/criteria # export WF_HOME=/data/data/criteria; export CRITERIA_HOME=/data/data/criteria

root@mb526:/data/data/criteria # ./executer TestNotePad

The program will perform the following steps:

1: Criteria session initialization (only one time)

----- for each process (begin) -----

2: Create process instance from template

3: Execute process instance just created

----- for each process (end) -----

4: Querying for activity pending

5: close criteria session

Press a Key for beginning................................................

2

Criteria session Initialization.....(look at Executor trace file)

Criteria session Initialization [KO].Error[Impossible to retrieve ${CRITERIA_HOME}]. Exit.

2|root@mb526:/data/data/criteria #

------------------------------------------------------------------------------------------

步骤(问题)13:

+++++++++++++编译Criteria.Tools.Executor————成功———调试

宿主机:

codeblocks 全局参数 设置:

【Settings】->【debugger】->【create config】->【arm-gdb】->【executable path】

/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb

【Settings】->【Compiler】->【GNU ARM GCC Compiler For Android】->【Toolchain executable】->【debugger】

arm-gdb

codeblocks 局部参数 设置:

右健单击【Criteria.WorkflowEngine】,选择【Properties】->【debugger】->【debug win32】192.168.0.101:1111

[root@localhost gdbserver]# pwd

/opt/android-on-linux/android-ndk-r8e/prebuilt/android-arm/gdbserver

[root@localhost gdbserver]# ls

gdbserver

[root@localhost gdbserver]# adb push gdbserver /data/data/criteria

[root@localhost lib]# pwd

/opt/cBPM-android/criteria-lin/lib

[root@localhost lib]# adb push executer /data/data/criteria

----------------------OK---------------------手机:

shell@mb526:/ $

getprop |grep ip

[dhcp.wlan0.ipaddress]: [192.168.0.101]

export WF_HOME=/data/data/criteria; export CRITERIA_HOME=/data/data/criteria

cd /data/data/criteria

./gdbserver 192.168.0.100:1234 ./executer

(192.168.0.100是宿主机IP)

----------------------OK---------------------宿主机(命令行):

[root@localhost Tools.Executor]# pwd

/opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor

[root@localhost Tools.Executor]# ls

database notepad.txt temp TestNotePad.xml executer Executor-3739-20150407-100423.trace src temp.c

------------------------------------------------------------------------这段不用

[root@localhost Tools.Executor]# export PATH=$PATH:/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/

使用上面有问题:

readchar: Got EOF

Remote side has terminated connection. GDBserver will reopen the connection.

------------------------------------------------------------------------将配置文件复制到 手机

[root@localhost lib]# pwd

/opt/cBPM-android/criteria-lin/lib

[root@localhost lib]# ls

executer

[root@localhost lib]# adb push executer /data/data/criteria/

[root@localhost Tools.Executor]# ls

database executer notepad.txt src temp temp.c TestNotePad.xml

[root@localhost Tools.Executor]# pwd

/opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor

[root@localhost Tools.Executor]# adb push database/ /data/data/criteria/database

------------------------------------------------------------------------

------------------------------------------------------------------------使用这段

使用下面可以:

[root@localhost Tools.Executor]# export PATH=$PATH:/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/

------------------------------------------------------------------------

gdb调试的时候如何带参数

1,gdb --args ./A V1 V2 V3

2,gdb ./A,进入gdb后 r V1 V2 V3

3,gdb ./A,进入gdb后 设置参数set args V1 V2 V3 再直接 r

------------------------------------------------------------------------

------------------------------------------------------------------------宿主机(命令行):

[root@localhost Tools.Executor]# arm-linux-androideabi-gdb executer

(gdb)

target extended-remote 192.168.0.104:1234

//192.168.0.101是手机IP

//target remote 192.168.0.101:1234

//break main.cpp:63

//break main.cpp:155

//break WAPI.cpp:72

//break bOSXMLHelper.cpp:40

//break PlatformUtils.hpp:813

//break MemoryManagerImpl.cpp:37

//break WorkflowListener.cpp:67

//break XMLString.hpp:1451

//break Hashers.hpp:47

//break RangeToken.cpp:335

//break XMLRangeFactory.cpp:113

//break XMLInitializer.cpp:51

//break XMLInitializer.cpp:62 // 调试到此处,停止

//break XMLInitializer.cpp:61 // 所以,进入到initializeDatatypeValidatorFactory()单步跟踪,使用s,不要用n

break IconvTransService.cpp:432 //找到了故障点(在这一行的)。

break IconvTransService.cpp:460 //估计是内存分配问题,比如 溢出

break DataBaseHelper.cpp:91

break bOSXMLHelper.cpp:64

break bOSFileSystem.cpp:191

break bOSXMLHelper.cpp:116

break AbstractDOMParser.cpp:537

set debug remote 1

set args TestNotePad

c

s

n

r

info break

delete breakpoint-number

backtrace

monitor exit //terminate gdbserver

------------------------------------------------------------------------调试到此处,停止,并且 手机重启

(gdb) bt

#0 xercesc_3_1::RangeToken::doCreateMap (this=0x5bece8) at xercesc/util/regx/RangeToken.cpp:852

#1 0x00327af4 in xercesc_3_1::RangeToken::createMap (this=0x5bece8) at ./xercesc/util/regx/RangeToken.hpp:130

#2 0x00331f84 in xercesc_3_1::XMLRangeFactory::buildRanges (this=0x5bd338, rangeTokMap=0x5ba2c8) at xercesc/util/regx/XMLRangeFactory.cpp:113

#3 0x0031f4c4 in xercesc_3_1::RangeTokenMap::buildTokenRanges (this=0x5ba2c8) at xercesc/util/regx/RangeTokenMap.cpp:247

#4 0x0031e8d8 in xercesc_3_1::XMLInitializer::initializeRangeTokenMap () at xercesc/util/regx/RangeTokenMap.cpp:49

#5 0x00219aac in xercesc_3_1::XMLInitializer::initializeStaticData () at xercesc/util/XMLInitializer.cpp:51

#6 0x0020ddac in xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0,

panicHandler=0x0, memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:307

#7 0x001534ac in bOS::XML::XMLHelper::initialize () at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp:40

#8 0x0000ec88 in InitSessionWithParams (acConfigFile=0x5b64b8 "/data/data/criteria/database/Criteria.xml", response=0x5b3b20)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp:72

#9 0x0000e948 in InitSession (response=0x5b3b20) at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/WAPI/WAPI.cpp:63

#10 0x0000b34c in main (argc=2, argv=0xbeb2fa34)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Tools/Criteria.Tools.Executor/src/main.cpp:63

break XMLInitializer.cpp:61 // 所以,进入到initializeDatatypeValidatorFactory()单步跟踪,使用s,不要用n

#2 0x002aaf1c in xercesc_3_1::DatatypeValidatorFactory::expandRegistryToFullSchemaSet (this=0x5e3870)

at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:180

#3 0x002aaca8 in xercesc_3_1::XMLInitializer::initializeDatatypeValidatorFactory () at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:135

break DatatypeValidatorFactory.cpp:180

break DatatypeValidatorFactory.cpp:281

break DatatypeValidatorFactory.cpp:315 // 到此处,手机死机

break DatatypeValidatorFactory.cpp:311 // 所以,单步跟踪

break DatatypeValidatorFactory.hpp:250 // 到此处,手机死机

break DatatypeValidatorFactory.hpp:246 // 所以,单步跟踪

#0 xercesc_3_1::RefHashTableOfEnumerator<xercesc_3_1::KVStringPair, xercesc_3_1::StringHasher>::~RefHashTableOfEnumerator (this=0xbed963e4,

__in_chrg=<optimized out>) at ./xercesc/util/RefHashTableOf.c:554

#1 0x003989d4 in xercesc_3_1::AbstractStringValidator::assignFacet (this=0x5e4a30, manager=0x5b6c98)

at xercesc/validators/datatype/AbstractStringValidator.cpp:221

#3 0x002bcaa0 in xercesc_3_1::StringDatatypeValidator::StringDatatypeValidator (this=0x5e4a30, baseValidator=0x5e3928, facets=0x5e4988, enums=0x0,

finalSet=0, manager=0x5b6c98) at xercesc/validators/datatype/StringDatatypeValidator.cpp:50

break AbstractStringValidator.cpp:221 // 所以,单步跟踪

break StringDatatypeValidator.cpp:50

#0 xercesc_3_1::StringDatatypeValidator::StringDatatypeValidator (this=0x5e4a30, baseValidator=0x5e3928, facets=0x5e4988, enums=0x0, finalSet=0,

manager=0x5b6c98) at xercesc/validators/datatype/StringDatatypeValidator.cpp:51

#1 0x002bcbbc in xercesc_3_1::StringDatatypeValidator::newInstance (this=0x5e3928, facets=0x5e4988, enums=0x0, finalSet=0, manager=0x5b6c98)

at xercesc/validators/datatype/StringDatatypeValidator.cpp:64

#2 0x002add30 in xercesc_3_1::DatatypeValidatorFactory::createDatatypeValidator (this=0x5e3870,

typeName=0x4da7b4 <xercesc_3_1::SchemaSymbols::fgDT_NORMALIZEDSTRING>, baseValidator=0x5e3928, facets=0x5e4988, enums=0x0,

isDerivedByList=false, finalSet=0, isUserDefined=false, userManager=0x5b6c98) at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:678

break DatatypeValidatorFactory.cpp:678

Breakpoint 2, xercesc_3_1::DatatypeValidatorFactory::expandRegistryToFullSchemaSet (this=0x5e3870)

at xercesc/validators/datatype/DatatypeValidatorFactory.cpp:312

312 getDatatypeValidator(XMLUni::fgNmTokenString), facets, 0, true, 0, false);

(gdb) break DatatypeValidatorFactory.cpp:312

(gdb) s

(gdb) n

(gdb)

manager=0x5b6c98) at xercesc/validators/datatype/ListDatatypeValidator.cpp:58

58 if (!baseValidator)

(gdb) break ListDatatypeValidator.cpp:58

(gdb) break ListDatatypeValidator.cpp:61

(gdb) s

(gdb) n

(gdb) break AbstractStringValidator.cpp:152

(gdb) s

xercesc_3_1::XMLString::parseInt (toConvert=0x5e52c0, manager=0x5b6c98) at xercesc/util/XMLString.cpp:1449

1449 XMLSize_t trimmedStrLen = XMLString::stringLen(trimmedStr);

xercesc_3_1::IconvLCPTranscoder::transcode (this=0x5b7d20, toTranscode=0x5e52d0, manager=0x5b6c98)

at xercesc/util/Transcoders/Iconv/IconvTransService.cpp:432

432 while (toTranscode[srcCursor] || src)

-----------------------找到了故障点

(gdb) break IconvTransService.cpp:432 //找到了故障点。

问题的解决,见 http://blog.chinaunix.net/uid-14735472-id-5211751.html
------------------------------------------------------------------------接着调试,调试到此处,出现如下问题 (段错误)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/DataBaseHelper.cpp:236

236 CM_TRACE_CODEPATH("Process [" << acWorkflowName << "] retrieved. [" << workflow->getProcessId() << "]")

Program terminated with signal SIGSEGV, Segmentation fault.

The program no longer exists.

(gdb)

是因为Connection Nr[0]

具体错误(在Executor-7033-20150407-163826.trace文件中)

10:39:39.550-1073824092- DataBaseHelper::open-INFO-DataBaseHelper.cpp[106]-Connection Nr[0]

应该为

16:38:26.424--134334400- DataBaseHelper::open-INFO-DataBaseHelper.cpp[106]-Connection Nr[1]

0:45:44.772--134334400- DataBaseHelper::open-INFO-DataBaseHelper.cpp[106]-Connection Nr[1]

20:45:44.772--134334400- DataBaseHelper::open-INFO-DataBaseHelper.cpp[171]-Analysing FileSsystem Connection

因为[106]出了问题,所以[171]没有执行,即,[111]行的 for 循环的 循环体 没有执行。

下面调试,找问题

(gdb) break DataBaseHelper.cpp:236

(gdb) break DataBaseHelper.cpp:109

--------------使用如下断点找问题

break DataBaseHelper.cpp:102

break bOSXMLFile.cpp:52

break bOSCollection.cpp:37

break bOSCollection.cpp:44

break bOSXMLFile.cpp:59

break DataBaseHelper.cpp:104

break bOSXMLObject.cpp:73 //初始化 vConnections 的 地方

break bOSXMLObject.cpp:89 //初始化 vConnections 的 地方,是虚函数,因此,执行时 定位 实际函数

// at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/DataBase.cpp:27

-----------------------找到了故障点 DataBase.cpp:27

if ( strcmp(node->getName(),XMLConnections::MAIN_NODE.c_str()) == 0 )

----------函数strcmp的 两个 参数 不同:"C" 和 "Connections"

_M_data = 0x5f6510 "C"

_M_data = 0x5813f8 <DataManager::Panorama::DataBase::XMLConnections::MAIN_NODE> "Connections"}

----------下面查找,第一个参数 为什么 是"C"

break bOSXMLNode.cpp:223 //void XMLNode::setName( const char* acName )

break setName

break bOSXMLHelper.cpp:157

break bOSXMLHelper.cpp:170

break XMLString.cpp:600

break IconvTransService.cpp:451

先设置断点

break bOSXMLHelper.cpp:170

执行后,再设置断点

break IconvTransService.cpp:529

break IconvTransService.cpp:569

//终于找到故障点: 文件 IconvTransService.cpp:451

size_t len = ::wcsrtombs(resultString + dstCursor, &src, resultSize - dstCursor, &st);

//Android中,wcsrtombs 有问题,所以 替换之

//修改如下文件:

/opt/cBPM-android/xerces-c-3.1.2/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp

bt

一个原因:在解析Criteria.xml文件时,只读取了 标签的 第一个字母。

(gdb) bt

#0 xercesc_3_1::IconvLCPTranscoder::transcode (this=0x5b7d20, toTranscode=0x5f7c5c, manager=0x5b6c98)

at xercesc/util/Transcoders/Iconv/IconvTransService.cpp:484

#1 0x0021b190 in xercesc_3_1::XMLString::transcode (toTranscode=0x5f7c5c, manager=0x5b6c98) at xercesc/util/XMLString.cpp:600

#2 0x0015401c in bOS::XML::XMLHelper::parse (domNode=0x5f7c20)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp:170

#3 0x00153c10 in bOS::XML::XMLHelper::parse (

acXML=0x5eff00 "<DataBaseManager> <Connections> <!-- <MySQL Type=\"Primary\" Id=\"1\"> <PoolManager Min=\"1\" Max=\"1\" Retry=\"0\" Delay=\"100\" />", ' ' <repeats 12 times>, "<Host>127.0.0.1</Host> <Port></Port> <User>cri"...)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp:157

--------------

shell@mb526:/ $

getprop |grep ip

[dhcp.wlan0.ipaddress]: [192.168.0.101]

export WF_HOME=/data/data/criteria; export CRITERIA_HOME=/data/data/criteria

cd /data/data/criteria

./gdbserver 192.168.0.100:1234 ./executer

--------------

break bOSXMLHelper.cpp:64

break bOSFileSystem.cpp:191

break bOSXMLHelper.cpp:116

break AbstractDOMParser.cpp:537

# pwd

/opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor

# export PATH=$PATH:/opt/android-on-linux/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/

# arm-linux-androideabi-gdb executer

target extended-remote 192.168.0.104:1234

set debug remote 1

set args TestNotePad

c

--------------

/opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/DataBaseHelper.cpp

line-106

CM_TRACE_INFO("Connection Nr[" << uiSize << "]")

DataManager::Panorama::DataBase::DataBase::init (this=0xbecf63c8)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/DataBase.cpp:17

17 vConnections.init();

DataManager::Panorama::DataBase::Connections::init (this=0xbecf63e8)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/DataBase/Connections.cpp:26

26 XMLObjectSet::init();

bOS::XML::Data::XMLObjectSet::init (this=0xbecf63e8)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/Data/bOSXMLObjectSet.cpp:38

38 this->removeAll();

bOS::Collections::Collection::removeAll (this=0xbecf63ec)

at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/Collections/bOSCollection.cpp:151

151 Mutex::Lock locker(mtxEntries);

bOS::Core::SmartLocker<bOS::Core::Mutex>::SmartLocker (this=0xbecf6314, lock=...) at /opt/cBPM-android/criteria-lin/include/bOS/bOSSmartLocker.h:19

19 SmartLocker( T& lock ) : m_Lock(lock), m_bLocked(false)

bOS::Core::Mutex::lock (this=0xbecf63fc) at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/Core/bOSMutex.cpp:43

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--------------------------------下面是宿主机(命令行) 执行 r s n c 的过程,目的是找到 故障点,太费时间,所以 结合 backtrace 查找 故障点

Breakpoint 4, bOS::XML::XMLHelper::initialize () at /opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp:40

40 xercesc_3_1::XMLPlatformUtils::Initialize();

(gdb)

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:166

166 {

xercesc_3_1::MemoryManagerImpl::MemoryManagerImpl (this=0x5b6c98) at ./xercesc/internal/MemoryManagerImpl.hpp:48

48 MemoryManagerImpl()

xercesc_3_1::MemoryManager::MemoryManager (this=0x5b6c98) at ./xercesc/framework/MemoryManager.hpp:108

108 MemoryManager()

xercesc_3_1::MemoryManagerImpl::MemoryManagerImpl (this=0x5b6c98) at ./xercesc/internal/MemoryManagerImpl.hpp:50

50 }

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:208

208 if (!panicHandler)

xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:34

34 {

xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813

813 XMLSize_t current = ptrSize % alignment;

xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:41

41 );

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37

37 {

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46

46 if(memptr==NULL && size!=0)

xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:42

42 *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager;

xercesc_3_1::DefaultPanicHandler::DefaultPanicHandler (this=0x5b6cb0) at ./xercesc/util/DefaultPanicHandler.hpp:46

46 DefaultPanicHandler(){};

xercesc_3_1::XMemory::XMemory (this=0x5b6cb0) at ./xercesc/util/XMemory.hpp:132

132 }

xercesc_3_1::PanicHandler::PanicHandler (this=0x5b6cb0) at ./xercesc/util/PanicHandler.hpp:70

70 PanicHandler(){};

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:223

223 endianTest.ch = 1;

xercesc_3_1::XMLPlatformUtils::makeMutexMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:725

725 XMLMutexMgr* mgr = NULL;

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:63

63 assert(manager != 0);

xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813

813 XMLSize_t current = ptrSize % alignment;

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:68

68 void* const block = manager->allocate(headerSize + size);

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37

37 {

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46

46 if(memptr==NULL && size!=0)

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:69

69 *(MemoryManager**)block = manager;

xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:44

44 PosixMutexMgr::PosixMutexMgr()

xercesc_3_1::XMLMutexMgr::XMLMutexMgr (this=0x5b6cc0) at ./xercesc/util/XMLMutexMgr.hpp:36

36 XMLMutexMgr() {}

xercesc_3_1::XMemory::XMemory (this=0x5b6cc0) at ./xercesc/util/XMemory.hpp:132

132 }

xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:46

46 }

xercesc_3_1::XMLPlatformUtils::makeMutexMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:737

737 return mgr;

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:249

249 fgFileMgr = makeFileMgr(fgMemoryManager);

xercesc_3_1::XMLPlatformUtils::makeFileMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:504

504 XMLFileMgr* mgr = NULL;

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:63

63 assert(manager != 0);

xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813

813 XMLSize_t current = ptrSize % alignment;

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37

37 {

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46

46 if(memptr==NULL && size!=0)

xercesc_3_1::XMemory::operator new (size=4) at xercesc/util/XMemory.cpp:42

42 *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager;

xercesc_3_1::DefaultPanicHandler::DefaultPanicHandler (this=0x5b6cb0) at ./xercesc/util/DefaultPanicHandler.hpp:46

46 DefaultPanicHandler(){};

xercesc_3_1::XMemory::XMemory (this=0x5b6cb0) at ./xercesc/util/XMemory.hpp:132

132 }

xercesc_3_1::PanicHandler::PanicHandler (this=0x5b6cb0) at ./xercesc/util/PanicHandler.hpp:70

70 PanicHandler(){};

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:223

223 endianTest.ch = 1;

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:63

63 assert(manager != 0);

Breakpoint 1, xercesc_3_1::XMLPlatformUtils::alignPointerForNewBlockAllocation (ptrSize=4) at ./xercesc/util/PlatformUtils.hpp:813

813 XMLSize_t current = ptrSize % alignment;

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:68

68 void* const block = manager->allocate(headerSize + size);

Breakpoint 2, xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:37

37 {

xercesc_3_1::MemoryManagerImpl::allocate (this=0x5b6c98, size=12) at xercesc/internal/MemoryManagerImpl.cpp:46

46 if(memptr==NULL && size!=0)

xercesc_3_1::XMemory::operator new (size=4, manager=0x5b6c98) at xercesc/util/XMemory.cpp:69

69 *(MemoryManager**)block = manager;

xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:44

44 PosixMutexMgr::PosixMutexMgr()

xercesc_3_1::XMLMutexMgr::XMLMutexMgr (this=0x5b6cc0) at ./xercesc/util/XMLMutexMgr.hpp:36

36 XMLMutexMgr() {}

xercesc_3_1::XMemory::XMemory (this=0x5b6cc0) at ./xercesc/util/XMemory.hpp:132

132 }

xercesc_3_1::PosixMutexMgr::PosixMutexMgr (this=0x5b6cc0) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:46

46 }

xercesc_3_1::XMLPlatformUtils::makeMutexMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:737

737 return mgr;

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:249

249 fgFileMgr = makeFileMgr(fgMemoryManager);

xercesc_3_1::XMLPlatformUtils::makeFileMgr (memmgr=0x5b6c98) at xercesc/util/PlatformUtils.cpp:504

504 XMLFileMgr* mgr = NULL;

...

循环 1065行

xercesc_3_1::PosixMutexWrap::PosixMutexWrap (this=0x5b6cf8) at xercesc/util/MutexManagers/PosixMutexMgr.cpp:38

38 class PosixMutexWrap : public XMemory {

xercesc_3_1::XMLPlatformUtils::Initialize (locale=0x4cebe0 <xercesc_3_1::XMLUni::fgXercescDefaultLocale> "en_US", nlsHome=0x0, panicHandler=0x0,

memoryManager=0x0) at xercesc/util/PlatformUtils.cpp:269

269 XMLInitializer::initializeTransService(); // TransService static data.

xercesc_3_1::RefHashTableOf<xercesc_3_1::ENameMap, xercesc_3_1::StringHasher>::put (this=0x5b6d30,

key=0x4ccf90 <xercesc_3_1::XMLUni::fgXMLChEncodingString>, valueToAdopt=0x5b6f90) at ./xercesc/util/RefHashTableOf.c:412

412 if (newBucket)

key=0x4ccde0 <xercesc_3_1::XMLUni::fgUSASCIIEncodingString>, hashVal=@0xbed324ec: 2180388) at ./xercesc/util/RefHashTableOf.c:492

492 hashVal = fHasher.getHashVal(key, fHashModulus);

key=0x4cce10 <xercesc_3_1::XMLUni::fgUSASCIIEncodingString4>, hashVal=@0xbed324ec: 93) at ./xercesc/util/RefHashTableOf.c:495

495 RefHashTableBucketElem<TVal>* curElem = fBucketList[hashVal];

xercesc_3_1::StringHasher::getHashVal (this=0x5b6d48, key=0x4cce24 <xercesc_3_1::XMLUni::fgUTF8EncodingString>, mod=103)

at ./xercesc/util/Hashers.hpp:47

47 }

xercesc_3_1::XMLTransService::initTransService (this=0x5b6f48) at xercesc/util/TransService.cpp:227

227 gMappings->put((void*)XMLUni::fgUSASCIIEncodingString, new ENameMapFor<XMLASCIITranscoder>(XMLUni::fgUSASCIIEncodingString));

xercesc_3_1::XMemory::operator new (size=8) at xercesc/util/XMemory.cpp:41

41 );

xercesc_3_1::XMLString::hash (tohash=0x4cce04 <xercesc_3_1::XMLUni::fgUSASCIIEncodingString3>, hashModulus=103) at ./xercesc/util/XMLString.hpp:1588

1588 if (tohash == 0 || *tohash == 0)

encodingName=0x4ccb48 <xercesc_3_1::XMLUni::fgISO88591EncodingString>) at ./xercesc/util/TransENameMap.c:32

32 ENameMapFor<TType>::ENameMapFor(const XMLCh* const encodingName) :

xercesc_3_1::ENameMap::ENameMap (this=0x5b7198, encodingName=0x4ccb48 <xercesc_3_1::XMLUni::fgISO88591EncodingString>)

at ./xercesc/util/TransENameMap.hpp:75

xercesc_3_1::XMLString::stringLen (src=0x4ccbbc <xercesc_3_1::XMLUni::fgISO88591EncodingString7>) at ./xercesc/util/XMLString.hpp:1451

1451 if (src == 0)

encodingName=0x4ccbcc <xercesc_3_1::XMLUni::fgISO88591EncodingString8>) at ./xercesc/util/TransENameMap.c:36

36 }

xercesc_3_1::RangeToken::addRange (this=0x5c2fc8, start=6155, end=6467) at xercesc/util/regx/RangeToken.cpp:335

335 fCaseIToken = 0;

Sending packet: $X98ff0,4:?\001??#27...Packet received: OK

Sending packet: $QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;#5f...Packet received: OK

Sending packet: $vCont;c:pc6b.-1#d9...

Sending packet: $m2abd08,4#8e...Packet received: 1c00a0e3

Sending packet: $X2abd08,4:?\001??#7b...Packet received: OK

Sending packet: $vCont;c:pcdf.-1#0b...

------调试到此处,停止,并且 手机重启

--------------------------------上面是 执行 r s n c 的过程,目的是找到 故障点,太费时间,所以 结合 backtrace 查找 故障点

------------------------------------------------------------------------

/opt/cBPM-android/criteria-lin/src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp

xercesc_3_1::XMLPlatformUtils::Initialize(); //程序至步于此,并且手机自动重启,说明xercesc_3_1有问题

include/bOS/xercesc/util/PlatformUtils.cpp

include/bOS/xercesc/util/XercesDefs.hpp: #define XERCES_CPP_NAMESPACE_BEGIN namespace XERCES_CPP_NAMESPACE {

--------------------将下面两个文件中xercesc_3_1替换为xercesc_3_0

[root@localhost criteria-lin]# pwd

/opt/cBPM-android/criteria-lin

./src/Criteria/Criteria.Libraries.bOS/XML/bOSXMLHelper.cpp

./include/bOS/bOSXMLHelper.h

--------------------编译xercesc_3_0静态库——以下 不看,不用了

编译xerces-c (静态库)—CentOS 7— android-ndk

[root@localhost xerces-c-3.0.0]# pwd

/opt/cBPM-android/xerces-c-3.0.0

[root@localhost xerces-c-3.0.0]# make clean

export XERCES="/opt/cBPM-android/xerces-c-3.0.0/"

export NDK_ROOT="/opt/android-on-linux/android-ndk-r8e"

export SYSROOT="$NDK_ROOT/platforms/android-14/arch-arm"

export CFLAGS="--pipe --sysroot=$SYSROOT -I$NDK_ROOT/sources/cxx-stl/stlport/stlport -I$NDK_ROOT/platforms/android-14/arch-arm/usr/include -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/include -I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include-fixed
-I$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/include"

export CPPFLAGS="$CFLAGS"

export CXXFLAGS="$CFLAGS"

export LDFLAGS="-L$SYSROOT/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/cBPM-android/criteria-lin/lib -lstlport_static -lgcc -lc"

export CPATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin"

export CPP="$CPATH/arm-linux-androideabi-cpp"

export CXX="$CPATH/arm-linux-androideabi-g++"

export CC="$CPATH/arm-linux-androideabi-gcc"

export LD="$CPATH/arm-linux-androideabi-ld"

export AR="$CPATH/arm-linux-androideabi-ar"

[root@localhost xerces-c-3.0.0]# ac_cv_func_iconv_open=yes ac_cv_func_iconv_close=yes ac_cv_func_mblen=yes ac_cv_func_wcstombs=yes ac_cv_func_mbstowcs=yes ac_cv_func_iconv=yes ./configure --host="arm-linux-eabi" --enable-static --disable-shared --enable-transcoder-iconv

[root@localhost xerces-c-3.0.0]# make -j5

[root@localhost xerces-c-3.0.0]# cp ./src/.libs/libxerces-c.a /opt/cBPM-android/criteria-lin/lib

至此,成功编译 xerces-c-3.0.0 静态库

---------------------------------

xercesc/util/XMLAbstractDoubleFloat.cpp:431:27: error: 'struct lconv' has no member named 'decimal_point'

[root@localhost xerces-c-3.0.0]# gedit ./src/xercesc/util/XMLAbstractDoubleFloat.cpp

// lconv* lc = localeconv();

// char delimiter = *lc->decimal_point;

char delimiter = '.'; //把localeconv()调用给绕过去了

保存,重新编译xerces-c (静态库)

---------------------------------

/usr/include/curl/curlbuild.h:1:27: fatal error: bits/wordsize.h: No such file or directory

/usr/include/curl/curlbuild.h:4:26: fatal error: curlbuild-32.h: No such file or directory

[root@localhost xerces-c-3.0.0]# find /usr/include/ -name wordsize.h

/usr/include/bits/wordsize.h

yum install libcurl-devel.i686

--------------------编译xercesc_3_0静态库——以上 不看,不用了

------------------------------------------------------------------------

[root@localhost lib]# /opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb

(gdb) file executer

进行调试

(gdb) list or l

(gdb) break func

(gdb) break 22

(gdb) info br

(gdb) continue or c // 这里不能用 run

(gdb) next or n

(gdb) print or p result

(gdb) finish // 跳出func函数

(gdb) next

(gdb) quit

建立连接后进行gdb远程调试和gdb本地调试方法相同

----------------------------------

/opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/WorkflowListener.cpp

注释掉两行:(取消注释,会出现上面问题,有待解决)

/opt/cBPM-android/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/BaseWorkflowEvent.cpp

==============================下面不用看

// 上面过程 重新 做一遍,使用 API level 15, NDK 9,arm-linux-androideabi-4.7,因为 我的手机2011年买的,Android 4.0(Ice Cream Sandwich冰淇淋三明治)

[root@localhost android-on-linux]# wget -c http://dl.google.com/android/ndk/android-ndk-r8-linux-x86.tar.bz2
[root@localhost android-on-linux]# wget -c https://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
[root@localhost android-on-linux]# wget -c https://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.tar.bz2
==============================下面不用看

解决方法:对比 helloworld

[root@localhost lib]# adb pull /data/data/helloworldcpp .

877 KB/s (102700 bytes in 0.114s)

[root@localhost lib]# ls

executer libc.so libiconv.so.2 libLibraries.so libstdc++.so libxerces-c-3.1.so temp.txt

helloworld libiconv.a libiconv.so.2.5.1 libsqlite.a libWorkflowEngineD.a libxerces-c.a

helloworldcpp libiconv.so libLibraries.a libsqlite.so libWorkflowEngineD.so temp2.txt

[root@localhost lib]#

********---------------------------********

库位置:

[root@localhost criteria-lin]# cd /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/

[root@localhost lib]# ls

crtbegin_dynamic.o crtend_so.o libdl.so libGLESv3.so libmediandk.so libOpenSLES.so libz.a

crtbegin_so.o libandroid.so libEGL.so libjnigraphics.so libm_hard.a libstdc++.a libz.so

crtbegin_static.o libc.a libGLESv1_CM.so liblog.so libm.so libstdc++.so rs

crtend_android.o libc.so libGLESv2.so libm.a libOpenMAXAL.so libthread_db.so

[root@localhost lib]# ls /opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a

libstlport_shared.so libstlport.so libstlport_static.a thumb

[root@localhost lib]# ls /opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a

include libgnustl_shared.so libgnustl_static.a libsupc++.a thumb

[root@localhost lib]# ls /opt/cBPM-android/criteria-lin/lib

libiconv.a libiconv.so.2 libLibraries.a libsqlite.a libWorkflowEngineD.a libxerces-c-3.1.so

libiconv.so libiconv.so.2.5.1 libLibraries.so libsqlite.so libWorkflowEngineD.so libxerces-c.a

[root@localhost lib]#

********---------------------------********

//从手机上复制库文件libsqlite.so,便于调试系统

adb pull <remote> <local>

adb push <local> <remote>

adb pull /system/lib/libsqlite.so /opt/cBPM-android/criteria-lin/lib

adb pull /system/lib/ /opt/cBPM-android/mb526-all-lib

+++++++++++++

src/Criteria/Criteria.Tools/Criteria.Tools.Executor/Tools.Executor.depend

line 1628: 1427877163 /opt/cBPM-android/criteria-lin/include/bOS/selfded.h

+++++++++++++

编译结果:

[root@localhost android-ndk-r10d]# ll /usr/lib64/libLibraries.so

-rwxr-xr-x. 1 root root 8120944 9月 16 11:09 /usr/lib64/libLibraries.so

[root@localhost android-ndk-r10d]# ll /usr/lib64/libWorkflowEngineD.so

-rwxr-xr-x. 1 root root 16783140 9月 16 11:11 /usr/lib64/libWorkflowEngineD.so

[root@localhost android-ndk-r10d]#

+++++++++++++编译Libraries 和 WorkflowEngineD 共享库后,手动 编译 executer

export ARMGXX="/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++"

$ARMGXX -L/opt/cBPM-android/criteria-lin/lib -L/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/ -L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/armv7-a/
-o /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/Tools.Executor/src/main.o -static
-nostdlib -Wl,-dy -ldl /opt/cBPM-android/criteria-lin/lib/libc.so -Wl,-dn -lgcc -lstlport_static -lsqlite -lxerces-c -lLibraries -lWorkflowEngineD /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o 2> log.txt

cat log.txt | cut -d: -f1 | uniq

-Wl,-dn -lLibraries -lWorkflowEngineD -lxerces-c -lsqlite -lstdc++ -lc -lstlport_static -Wl,-dy

静态库位置: /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/

/opt/cBPM-android/criteria-lin/lib/

[root@localhost criteria-lin]# cd /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/

[root@localhost lib]# ls

crtbegin_dynamic.o crtend_so.o libdl.so libGLESv3.so libmediandk.so libOpenSLES.so libz.a

crtbegin_so.o libandroid.so libEGL.so libjnigraphics.so libm_hard.a libstdc++.a libz.so

crtbegin_static.o libc.a libGLESv1_CM.so liblog.so libm.so libstdc++.so rs

crtend_android.o libc.so libGLESv2.so libm.a libOpenMAXAL.so libthread_db.so

[root@localhost lib]# ls /opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a

libstlport_shared.so libstlport.so libstlport_static.a thumb

[root@localhost lib]# ls /opt/cBPM-android/criteria-lin/lib

libiconv.a libiconv.so.2 libLibraries.a libsqlite.a libWorkflowEngineD.a libxerces-c-3.1.so

libiconv.so libiconv.so.2.5.1 libLibraries.so libsqlite.so libWorkflowEngineD.so libxerces-c.a

[root@localhost lib]#

+++++++++++++杂项,不必看

//--enable-transcoder-gnuiconv --enable-transcoder-iconv --enable-transcoder-icu

// 下载xerces:

// http://stackoverflow.com/questions/12920620/trying-to-build-xerces-c-for-android
// https://github.com/pelya/commandergenius/tree/sdl_android/project/jni/xerces
+++++++++++++链接选项

-static

-nostdlib

-Xlinker

-R/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

-Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn

-static

-nostdlib

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o

/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

-Wl,-v -Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn

-static

-nostdlib

-Wl,-rpath-link=/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib -L/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_dynamic.o
/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

-Wl,-v -Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn

+++++++++++++++++++

-static

On systems that support dynamic linking, this prevents linking with the shared libraries. On other systems, this option

has no effect.

-shared

Produce a shared object which can then be linked with other objects to form an executable. Not all systems support this

option. For predictable results, you must also specify the same set of options used for compilation (-fpic, -fPIC, or

model suboptions) when you specify this linker option.[1]

+++++++++++++++++++

-------------- Build: Debug Win32 in Criteria.Libraries.bOS (compiler: GNU ARM GCC Compiler For Android)---------------

arm-linux-androideabi-ar -r -s ../../../bin/Criteria/Debug/bOS/libLibraries.a ../../../bin/Criteria/Debug/bOS/bOS.o ../../../bin/Criteria/Debug/bOS/CodeManager/CodeItem.o ../../../bin/Criteria/Debug/bOS/CodeManager/CodeTracer.o ../../../bin/Criteria/Debug/bOS/CodeManager/Tracer.o
../../../bin/Criteria/Debug/bOS/Collections/bOSCollection.o ../../../bin/Criteria/Debug/bOS/Collections/bOSCollectionEntry.o ../../../bin/Criteria/Debug/bOS/Core/bOSMutex.o ../../../bin/Criteria/Debug/bOS/Core/bOSSemaphore.o ../../../bin/Criteria/Debug/bOS/Core/bOSSmartLocker.o
../../../bin/Criteria/Debug/bOS/Core/bOSThread.o ../../../bin/Criteria/Debug/bOS/Exception/bOSException.o ../../../bin/Criteria/Debug/bOS/IO/bOSFile.o ../../../bin/Criteria/Debug/bOS/IO/bOSFileSystem.o ../../../bin/Criteria/Debug/bOS/JniInvoker.o ../../../bin/Criteria/Debug/bOS/Network/bOSSocketException.o
../../../bin/Criteria/Debug/bOS/Network/bOSSockets.o ../../../bin/Criteria/Debug/bOS/SQL/bOSResultSet.o ../../../bin/Criteria/Debug/bOS/SQL/bOSResultSetField.o ../../../bin/Criteria/Debug/bOS/SQL/bOSResultSetMetaData.o ../../../bin/Criteria/Debug/bOS/SQL/bOSResultSetRecord.o
../../../bin/Criteria/Debug/bOS/SQL/bOSSQLCommand.o ../../../bin/Criteria/Debug/bOS/SQL/bOSSQLCommands.o ../../../bin/Criteria/Debug/bOS/SQL/bOSSQLConnection.o ../../../bin/Criteria/Debug/bOS/SQL/bOSSQLConnectionManager.o ../../../bin/Criteria/Debug/bOS/SQL/bOSSQLConnectionPool.o
../../../bin/Criteria/Debug/bOS/SQL/bOSSQLField.o ../../../bin/Criteria/Debug/bOS/SQL/bOSSQLSmartConnection.o ../../../bin/Criteria/Debug/bOS/SQL/bOSSQLTable.o ../../../bin/Criteria/Debug/bOS/SQL/SQLite3/3rdLibraries/CppSQLite3.o ../../../bin/Criteria/Debug/bOS/SQL/SQLite3/3rdLibraries/sqlite3.o
../../../bin/Criteria/Debug/bOS/SQL/SQLite3/bOSSQLiteConnection.o ../../../bin/Criteria/Debug/bOS/SQL/SQLite3/bOSSQLiteConnectionData.o ../../../bin/Criteria/Debug/bOS/SQL/SQLite3/bOSSQLiteResultSet.o ../../../bin/Criteria/Debug/bOS/SQL/SQLite3/bOSSQLiteResultSetField.o
../../../bin/Criteria/Debug/bOS/SQL/SQLite3/bOSSQLiteResultSetMetaData.o ../../../bin/Criteria/Debug/bOS/String/bOSString.o ../../../bin/Criteria/Debug/bOS/String/bOSStringBuffer.o ../../../bin/Criteria/Debug/bOS/String/bOSStringUtils.o ../../../bin/Criteria/Debug/bOS/System/bOSProcess.o
../../../bin/Criteria/Debug/bOS/System/bOSSystem.o ../../../bin/Criteria/Debug/bOS/Utils/bOSDate.o ../../../bin/Criteria/Debug/bOS/Utils/bOSDateTime.o ../../../bin/Criteria/Debug/bOS/Utils/bOSTime.o ../../../bin/Criteria/Debug/bOS/Utils/bOSTimer.o ../../../bin/Criteria/Debug/bOS/Utils/bOSUniqueID.o
../../../bin/Criteria/Debug/bOS/XML/bOSXMLAttribute.o ../../../bin/Criteria/Debug/bOS/XML/bOSXMLHelper.o ../../../bin/Criteria/Debug/bOS/XML/bOSXMLNode.o ../../../bin/Criteria/Debug/bOS/XML/Data/bOSXMLObject.o ../../../bin/Criteria/Debug/bOS/XML/Data/bOSXMLObjectSet.o
../../../bin/Criteria/Debug/bOS/XML/Data/FileSystem/bOSXMLDirectory.o ../../../bin/Criteria/Debug/bOS/XML/Data/FileSystem/bOSXMLFile.o ../../../bin/Criteria/Debug/bOS/XML/XSLT/bOSXSLTManager.o

Running target post-build steps

cp /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/bOS/libLibraries.a /opt/cBPM-android/criteria-lin/lib/

-------------- Build: Debug Win32 in Criteria.WorkflowEngine (compiler: GNU ARM GCC Compiler For Android)---------------

arm-linux-androideabi-ar -r -s ../../../bin/Criteria/Debug/WorkflowEngine/libWorkflowEngineD.a ../../../bin/Criteria/Debug/WorkflowEngine/actions/ApplicationFunctionAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/ApplicationFunctionActionAttach.o
../../../bin/Criteria/Debug/WorkflowEngine/actions/BaseAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/ConditionAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/ConsumeEventAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/EvalExpressionAction.o
../../../bin/Criteria/Debug/WorkflowEngine/actions/EvalRetrieveParameter.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/EventAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/IterationAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/IterationCounterAction.o
../../../bin/Criteria/Debug/WorkflowEngine/actions/IterationExpressionAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/MakeEventAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/PrimitiveAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/PrimitiveActionAttach.o
../../../bin/Criteria/Debug/WorkflowEngine/actions/PrimitiveActionDetach.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/ProcessAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/ProcessActionAttach.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/SubFlowExitAction.o
../../../bin/Criteria/Debug/WorkflowEngine/actions/XMLAction.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/XMLActionXMLFile.o ../../../bin/Criteria/Debug/WorkflowEngine/actions/XMLActionXSLT.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/Application.o
../../../bin/Criteria/Debug/WorkflowEngine/Application/ApplicationException.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/ApplicationFunction.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/ApplicationFunctionResult.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/ApplicationFunctions.o
../../../bin/Criteria/Debug/WorkflowEngine/Application/ApplicationManager.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/Applications.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/FunctionExecution.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/LibraryFunctionExecution.o
../../../bin/Criteria/Debug/WorkflowEngine/Application/ProcessFunctionExecution.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/ScriptFunctionExecution.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/SocketFunctionExecution.o ../../../bin/Criteria/Debug/WorkflowEngine/Application/SQLApplicationDataModelDefines.o
../../../bin/Criteria/Debug/WorkflowEngine/Application/XMLApplicationDataModelDefines.o ../../../bin/Criteria/Debug/WorkflowEngine/CommonDefines.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Activities.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Activity.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/ActivityComponent.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Attribute.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Attributes.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Behaviour.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/BehaviourBase.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/BehaviourExecution.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/BehaviourFinish.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/BehaviourStart.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Connection.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Connections.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataBase.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataBaseHelper.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataBaseObject.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataBaseObjectManager.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataBaseTemplate.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataType.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataTypes.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataTypeValue.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/DataTypeValues.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/ExtendedAttribute.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/ExtendedAttributes.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/FileSystemConnection.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/FileSystemDataBase.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/FormalParameter.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/FormalParametes.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Grant.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Grants.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Log.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Logs.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Message.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Messages.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/mySQLConnection.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/ODBCConnection.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/PoolManager.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/ProcessComponent.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/ProcessesHandler.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Report.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Reports.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Role.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Roles.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Script.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Service.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Services.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/SQLDataBaseDefines.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/SQLiteConnection.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Status.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Transition.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Transitions.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/User.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/Users.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/WorkflowProcess.o
../../../bin/Criteria/Debug/WorkflowEngine/DataBase/WorkflowProcessInstanceRepository.o ../../../bin/Criteria/Debug/WorkflowEngine/DataBase/XMLDataModelDefines.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/Engine.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/EventsManagerThread.o
../../../bin/Criteria/Debug/WorkflowEngine/engine/IDataType.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/IWorkflow.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/NaturalType.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/Workflow.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/WorkflowManager.o
../../../bin/Criteria/Debug/WorkflowEngine/engine/WorkflowReport.o ../../../bin/Criteria/Debug/WorkflowEngine/engine/WorkFlowThread.o ../../../bin/Criteria/Debug/WorkflowEngine/events/BaseEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/BaseProcessEvent.o
../../../bin/Criteria/Debug/WorkflowEngine/events/BaseWorkflowEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/CreatedProcessEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/CreatingProcessEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/EndWorkflowEvent.o
../../../bin/Criteria/Debug/WorkflowEngine/events/ErrorWorkflowEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/EventListener.o ../../../bin/Criteria/Debug/WorkflowEngine/events/EventMaker.o ../../../bin/Criteria/Debug/WorkflowEngine/events/ManualWorkflowEvent.o
../../../bin/Criteria/Debug/WorkflowEngine/events/RestartedWorkflowEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/StartedWorkflowEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/StartingWorkflowEvent.o ../../../bin/Criteria/Debug/WorkflowEngine/events/WorkflowListener.o
../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/Event.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventActions.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventConsumerPolicy.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventContext.o
../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventInvocationPolicy.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventPolicies.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/Events.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventsDefinition.o
../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventsManager.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/EventSource.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/ManagedEventElement.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/OccurredEvent.o
../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/ScenarioEventAction.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/WaitingActivities.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/WaitingActivity.o ../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/WaitingEvent.o
../../../bin/Criteria/Debug/WorkflowEngine/ExternalEvent/XMLEventDataModelDefines.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/Condition.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/Evaluator.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/Expression.o
../../../bin/Criteria/Debug/WorkflowEngine/Idioma/FreeText.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/Function.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/ItemInterface.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/Keyword.o ../../../bin/Criteria/Debug/WorkflowEngine/Idioma/Parameter.o
../../../bin/Criteria/Debug/WorkflowEngine/tasks/ApplicationFunctionTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/BaseTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/BeginTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/ConditionTask.o
../../../bin/Criteria/Debug/WorkflowEngine/tasks/EventTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/LoopTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/PrimitiveTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/ProcessTask.o ../../../bin/Criteria/Debug/WorkflowEngine/tasks/SubFlowExitTask.o
../../../bin/Criteria/Debug/WorkflowEngine/tasks/XMLTask.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/Logger.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPI.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIActivity.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIApplication.o
../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIDataBase.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIDataType.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIProcess.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIReport.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIRole.o
../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIService.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIUser.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIWorkflow.o ../../../bin/Criteria/Debug/WorkflowEngine/WAPI/WAPIWorkItem.o

Running target post-build steps

cp /opt/cBPM-android/criteria-lin/bin/Criteria/Debug/WorkflowEngine/libWorkflowEngineD.a /opt/cBPM-android/criteria-lin/lib/

-------------- Build: Debug Win32 in Criteria.Tools.Executor (compiler: GNU ARM GCC Compiler For Android)---------------

arm-linux-androideabi-g++ -L/opt/cBPM-android/criteria-lin/lib -L/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a -L/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/ -L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/armv7-a/
-o /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/src/main.o -static -nostdlib -Wl,-v
-Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn -lgcc -lsqlite -lxerces-c -lLibraries -lWorkflowEngineD /opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

collect2 version 4.9 20140827 (prerelease)

/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld -plugin /opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.7/liblto_plugin.so
-plugin-opt=/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccwc8SHF.res --sysroot=/tmp/ndk-andrewhsieh/build/toolchain/prefix/sysroot
--eh-frame-hdr -Bstatic -X -m armelf_linux_eabi -z noexecstack -z relro -z now -o /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/executer -L/opt/cBPM-android/criteria-lin/lib -L/opt/android-on-linux/android-ndk-r8e/sources/cxx-stl/stlport/libs/armeabi-v7a
-L/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/ -L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.7/armv7-a/ -L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9
-L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc -L/opt/android-on-linux/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/lib
/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtbegin_static.o /opt/cBPM/criteria-lin/bin/Criteria/Debug/Tools.Executor/src/main.o -v -dy -lc -ldl -lstlport -lstdc++ -dn -lgcc -lsqlite -lxerces-c -lLibraries -lWorkflowEngineD
/opt/android-on-linux/android-ndk-r8e/platforms/android-14/arch-arm/usr/lib/crtend_android.o

src/main.cpp:155: error: undefined reference to '__cxa_end_cleanup'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: