As per google's new announcement for mobile apps to Support 64 bit architecture to upload or update the App to Google Playstore, I started working on it by changing the native c++ SDK to support x86_64 bit architecture. I am getting an errors when using the 64bit compiler.
I am getting an ambiguous error when calling this code NeedWriteJson(int64_t int64Val) and apart from this i am getting another error with respect to the same scenario which i have mentioned below(Error 2)
I am using this compiler options for 32 bit compilation:
/usr/local/android-x86toolchain/bin/i686-linux-android-g++
Is there any compiler flags i have to add to support this changed? since i have to change in more number of places with respect to memory.
My Compiler Options
/usr/local/android-toolchain-x86_64/bin/x86_64-linux-android-g++ -DANDROID -I/Users/vishnu/MyProject/MyMobileApp/shared/../include -I/Users/vishnu/MyProject/MyMobileApp/shared/../include/core/external/aes -I/Users/vishnu/MyProject/MyMobileApp/shared/../include/core/external/md5 -I/Users/vishnu/MyProject/MyMobileApp/shared/../include/core/external/rapidjson -I/Users/vishnu/MyProject/MyMobileApp/shared/../include/core/external/sqlite -I/Users/vishnu/MyProject/MyMobileApp/shared/../include/core/external/sqliteCpp -I/Users/vishnu/MyProject/MyMobileApp/shared/../../External/libs/android/include -I/Users/vishnu/MyProject/MyMobileApp/shared/../../External/libs/android/include/openssl -isystem /usr/local/android-x86toolchain/sysroot/usr/include -isystem /usr/local/android-x86toolchain/include/c++/4.8 -isystem /usr/local/android-x86toolchain/include/c++/4.8/i686-linux-android -fpic --sysroot=/usr/local/android-x86toolchain/sysroot -funwind-tables -funswitch-loops -finline-limit=300 -fsigned-char -no-canonical-prefixes -fdata-sections -ffunction-sections -Wa,--noexecstack -pipe -fno-inline -fno-eliminate-unused-debug-types -std=c++11 -pthread -fPIC -frtti -fexceptions -D__GXX_EXPERIMENTAL_CXX0X__ -DANDROID -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_FTS3 -DUSE_OPENSSL -DUSE_SSLEAY -DCURL_STATICLIB -D_GLIBCXX_USE_C99_STDINT_TR1 -D_GLIBCXX_HAS_GTHREADS -fomit-frame-pointer -fstrict-aliasing -O2 -DNDEBUG -fPIC -MD -MT MyMobileApp/wrapper/Android/build/student/jni/jniStudent.cpp.o -MF MyMobileApp/wrapper/Android/build/student/jni/jniStudent.cpp.o.d -o MyMobileApp/wrapper/Android/build/student/jni/jniStudent.cpp.o -c /Users/vishnu/MyProject/MyMobileApp/wrapper/Android/build/student/jni/jniStudent.cpp
For 64 bit compilation:
/usr/local/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++.
Since we dont need to create a standalone toolchain its using clang++.
virtual bool NeedWriteJson(bool boolVal) = 0;
virtual bool NeedWriteJson(int32_t int32Val) = 0;
virtual bool NeedWriteJson(int64_t int64Val) = 0;
virtual bool NeedWriteJson(std::string strVal) = 0;
virtual bool NeedWriteJson(double strVal) = 0;
Error1: error: call to member function 'NeedWriteJson' is ambiguous return toJsonController->NeedWriteJson(llongVal);
Error 2:
error: no matching constructor for initialization of 'std::vector<std::string>' (aka 'vector<basic_string<char, char_traits<char>, allocator<char> > >')
vec2(ptr ? std::vector<std::string>((char*)ptr, (char*)ptr + size) : std::vector<std::string>()) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/vector:518:5: note: candidate constructor not viable: no known conversion from 'char *' to 'std::__ndk1::vector<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::allocator<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > >::size_type' (aka 'unsigned long') for 1st argument; dereference the argument with *
vector(size_type __n, const value_type& __x);
^