0

我有一个基于 C++ 语言的 VPNC linux 开源。下载链接是:http ://www.unix-ag.uni-kl.de/~massar/vpnc/ (我使用vpnc-0.5.3.tar.gz)。

所以,我想在 Windows 上使用 android ndk 和 cygwin 将所有源代码构建到 .so 库。

首先,当我在 cygwin 上编译源代码时出现错误:“grcypt.h 没有这样的文件或目录”,我通过将 gcrypt.h 文件粘贴到 android 项目的 jni 文件夹来解决它。但我输入以下问题:

$ /cygdrive/C/Working/Ke/Android/android-ndk-r8b/ndk-build
SharedLibrary  : libvpnc.so
./obj/local/armeabi/objs/vpnc/vpnc.o: In function `lifetime_ike_process':
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:1171: undefined reference to `opt_debug'
./obj/local/armeabi/objs/vpnc/vpnc.o: In function `lifetime_ipsec_process':
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:1189: undefined reference to `opt_debug'
./obj/local/armeabi/objs/vpnc/vpnc.o: In function `make_socket':
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:242: undefined reference to `error'
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:219: undefined reference to `error'
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:231: undefined reference to `error'
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:238: undefined reference to `error'
./obj/local/armeabi/objs/vpnc/vpnc.o: In function `isakmp_crypt':
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:531: undefined reference to `xallocc'
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:532: undefined reference to `gcry_cipher_open'
C:\Working\Ke\Projects\Eclipse\AndroidVpnc/jni/vpnc.c:533: undefined reference to `gcry_cipher_setkey'

请给我这个问题的解决方案。

非常感谢。

4

1 回答 1

0

You have to include the libraries that contains opt_debug, error, xalloc, gcry_cipher_open and gcry_cipher_setkey as well.

于 2012-09-14T04:33:25.297 回答