1

I tried to compile swiften (a XMPP client library) into a lib for Android JNI but failed. Is there anyone successed? Any suggestion would be appreciated.

I compiled swiften as follow steps:

  1. Downloaded swiften from http://swift.im/git/swift/commit/?id=13a3f7812520d44e374d7c391daf2128335ac067
  2. Do as follow document: http://swift.im/git/swift/commit/?h=sandbox/tobias/android&id=b8e69ea59b471e1aff9c8db06aceb7108db0657b
  3. since I only need swiften, so I compile as: ./scons Swiften target=android toolchain=/home/XXX/toolchain

Then I got follow problems:

  1. can't find cryptlib.c, so I downloaded openssl and this fixed.
  2. can't find arpa/nameser_compat.h. Then I copied this header files from /usr/include to tool-chain, and added #define BSD 199307 at the begining.
  3. can't find the declarations of res_init(), res_query(), dn_expand(), dn_skipname(). So I added the declarations.

And finally I got libSwiften.a which the size is 260M. And there are about 200 link errors:

  AR Swiften/libSwiften.a
  RANLIB Swiften/libSwiften.a
  LINK Swiften/Examples/BenchTool/BenchTool
3rdParty/OpenSSL/openssl/crypto/objects/obj_dat.c:489: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/objects/obj_dat.c:579: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/objects/obj_dat.c:601: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/bio/bss_file.c:368: error: undefined reference to 'BUF_strlcpy'
3rdParty/OpenSSL/openssl/crypto/err/err.c:1104: error: undefined reference to 'BUF_strlcat'
3rdParty/OpenSSL/openssl/crypto/x509v3/v3_enum.c:94: error: undefined reference to 'BUF_strdup'
3rdParty/OpenSSL/openssl/crypto/x509v3/v3_purp.c:199: error: undefined reference to 'BUF_strdup'
3rdParty/OpenSSL/openssl/crypto/x509v3/v3_purp.c:200: error: undefined reference to 'BUF_strdup'
some more......
Flow
  • 23,572
  • 15
  • 99
  • 156
kenny
  • 11
  • 3

0 Answers0