cryptopp icon indicating copy to clipboard operation
cryptopp copied to clipboard

Build failure on Android

Open haoshuwen3 opened this issue 8 years ago • 3 comments

I follow the guide of cross-compiling Crypto++ on the command line for Android. https://www.cryptopp.com/wiki/Android_(Command_Line), But I couldn't build successfully. Here's the errors.

In file included from /opt/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40:0,
                 from /opt/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/char_traits.h:40,
                 from /opt/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/string:40,
                 from stdcpp.h:14,
                 from cryptlib.h:103,
                 from cryptlib.cpp:18:
/opt/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44:19: fatal error: wchar.h: No such file or directory
 #include <wchar.h>

System (Centos 7 x64) Version (6.1.0)

haoshuwen3 avatar Apr 23 '18 06:04 haoshuwen3

What version of Crypto++ are you using, and where did setenv-android.sh come from? Also, which compiler are you using?

android-ndk-r10e is from May 2015. Around the time we were adding Android support so setenv-android.sh may have some gaps.

noloader avatar Apr 26 '18 02:04 noloader

@noloader Thank you for your help. I had solved the issue by upgrade NDK to the latest r16. The comand lines works fine now, however it couldn't compile by NDK-10 yet. The issue could be closed now.

haoshuwen3 avatar Apr 26 '18 08:04 haoshuwen3

however it couldn't compile by NDK-10 yet.

I'm thinking you may have better luck with r10e by using TestScripts/setenv-android-old.sh.

The current setenv-android.sh was rewritten several months ago for the latest NDKs. Also see Commit 7aa3377bbdfa, where we stashed the old setenv-android.sh away under the name setenv-android-old.sh .

Another twist is, [setenv-android.sh] was renamed to setenv-android-gcc.sh because Clang is going to be the new default for the NDK. So we are getting ready to update things again.

You can see the full history at https://github.com/weidai11/cryptopp/commits/master/TestScripts/setenv-android.sh .

noloader avatar Apr 26 '18 11:04 noloader