Hi
I'm new to Cryptopp.
I trying to build Cryptopp for android and there are some problems. 
my gradle:
android {
compileSdk 32

defaultConfig {
minSdk 21
targetSdk 32
consumerProguardFiles "consumer-rules.pro"
externalNativeBuild {
ndkBuild {
cppFlags ''
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 
'proguard-rules.pro'
}
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
ndkVersion "19.2.5345600"
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir 'src/main/libs'
}
externalNativeBuild {
ndkBuild {
path file('../cryptopp/Android.mk')
}
}
}

i using documentation here: https://github.com/noloader/cryptopp-android-mk
I am not able to resolve following linker errors

> Build command failed.
  Error while executing process 
../Library/Android/sdk/ndk/19.2.5345600/ndk-build with arguments 
{NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=../cryptopp/Android.mk 
NDK_APPLICATION_MK=../cryptopp/Application.mk APP_ABI=x86_64 
NDK_ALL_ABIS=x86_64 NDK_DEBUG=1 APP_PLATFORM=android-21 
NDK_OUT=../build/intermediates/cxx/Debug/1rh2g6x2/obj 
NDK_LIBS_OUT=../build/intermediates/cxx/Debug/1rh2g6x2/lib APP_CPPFLAGS+= 
cryptopp_shared}
  Crypto++: NDK r16 or later. Use c++_shared instead of c++_static
  [x86_64] Compile++      : cryptopp_shared <= cryptlib.cpp
  [x86_64] Compile++      : cryptopp_shared <= cpu.cpp
  [x86_64] Compile++      : cryptopp_shared <= integer.cpp
  [x86_64] Compile        : cpufeatures <= cpu-features.c
  [x86_64] StaticLibrary  : libcpufeatures.a
  [x86_64] Compile++      : cryptopp_aria <= aria_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_aria.a
  [x86_64] Compile++      : cryptopp_blake2s <= blake2s_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_blake2s.a
  [x86_64] Compile++      : cryptopp_blake2b <= blake2b_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_blake2b.a
  [x86_64] Compile++      : cryptopp_chacha <= chacha_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_chacha.a
  [x86_64] Compile++      : cryptopp_chacha_avx <= chacha_avx.cpp
  [x86_64] StaticLibrary  : libcryptopp_chacha_avx.a
  [x86_64] Compile++      : cryptopp_crc <= crc_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_crc.a
  [x86_64] Compile++      : cryptopp_gcm <= gcm_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_gcm.a
  [x86_64] Compile++      : cryptopp_gf2n <= gf2n_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_gf2n.a
  [x86_64] Compile++      : cryptopp_lea <= lea_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_lea.a
  [x86_64] Compile++      : cryptopp_lsh256_sse <= lsh256_sse.cpp
  [x86_64] StaticLibrary  : libcryptopp_lsh256_sse.a
  [x86_64] Compile++      : cryptopp_lsh256_avx <= lsh256_avx.cpp
  [x86_64] StaticLibrary  : libcryptopp_lsh256_avx.a
  [x86_64] Compile++      : cryptopp_lsh512_sse <= lsh512_sse.cpp
  [x86_64] StaticLibrary  : libcryptopp_lsh512_sse.a
  [x86_64] Compile++      : cryptopp_lsh512_avx <= lsh512_avx.cpp
  [x86_64] StaticLibrary  : libcryptopp_lsh512_avx.a
  [x86_64] Compile++      : cryptopp_rijndael <= rijndael_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_rijndael.a
  [x86_64] Compile++      : cryptopp_sm4 <= sm4_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_sm4.a
  [x86_64] Compile++      : cryptopp_sha <= sha_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_sha.a
  [x86_64] Compile++      : cryptopp_shacal2 <= shacal2_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_shacal2.a
  [x86_64] Compile++      : cryptopp_simon <= simon128_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_simon.a
  [x86_64] Compile++      : cryptopp_speck <= speck128_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_speck.a
  [x86_64] Compile++      : cryptopp_sse <= sse_simd.cpp
  [x86_64] StaticLibrary  : libcryptopp_sse.a
  [x86_64] SharedLibrary  : libcryptopp_shared.so
  
  grep: /source.properties: No such file or directory
- C/C++: 
../Android/sdk/ndk/19.2.5345600/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld:
 
the vtable symbol may be undefined because the class is missing its key 
function
- C/C++: clang++: error: linker command failed with exit code 1 (use -v to 
see invocation)
- make: *** 
[../build/intermediates/cxx/Debug/1rh2g6x2/obj/local/x86_64/libcryptopp_shared.so]
 
Error 1
- C/C++: 
../build/intermediates/cxx/Debug/1rh2g6x2/obj/local/x86_64/objs-debug/cryptopp_shared/integer.o:integer.cpp:vtable
 
for CryptoPP::BERSequenceDecoder: error: undefined reference to 
'CryptoPP::BERGeneralDecoder::CopyRangeTo2(CryptoPP::BufferedTransformation&, 
unsigned long&, unsigned long, std::__ndk1::basic_string<char, 
std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, 
bool) const'

-- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/f168827f-fd4e-4dae-ae3c-00d78729fb26n%40googlegroups.com.

Reply via email to