无法为IOS编译Crypto ++库

时间:2016-03-04 06:55:31

标签: ios xcode static-libraries crypto++

我正在尝试为ios构建静态cryptopp库。我基于这些网站的步骤: http://cryptopp.com/wiki/IOS_(Command_Line)#Xcode_Project
https://github.com/noloader/cryptopp-5.6.2-ios
https://www.cryptopp.com/

1。)我下载了最新的cryptopp版本5.6.3
2.)我下载了noloader的cryptopp-5.6.2-ios,因为它已更新:

setenv-ios.sh - i had to edit this to search for sdk 9.2
GNUmakefile
config.h
build-for-ios.sh


3.)我将这四个文件复制到我的cryptopp 5.6.3目录并替换了GNUmakefile和config.h
4.)我检查了IOS_Command_Line指令,首先调用setenv-ios.sh。
5.)然后,正如noloader所说,运行build-for-ios.sh。

但是,我收到此错误: enter image description here


有没有人使用最新的ios SDK和cryptopp版本成功构建了库?如果是这样,请指点我正确的方向。感谢。

1 个答案:

答案 0 :(得分:1)

IOS (Command Line) | Build the Library下的文档不正确。使用setenv-ios.sh设置环境后,您应该使用GNUmakefile-cross

$ make -f GNUmakefile-cross static dynamic cryptest.exe
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor  -arch armv7 -isysroot 
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c cryptlib.cpp
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor  -arch armv7 -isysroot 
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c cpu.cpp
clang++ -DNDEBUG -g2 -Os -fPIC -pipe -Wall -Wno-delete-non-virtual-dtor  -arch armv7 -isysroot 
/Applications/Xcode-5_1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
-stdlib=libc++ -c 3way.cpp
...

想到我们在更新Android程序时更新了iOS程序。我不确定文档更新出了什么问题。

我们在2016年3月检查了setenv-ios.shsetenv-android.shsetenv-embedded.sh的脚本。GNUmakefile-cross已经在库中。另请参阅Commit a78b9dfa0840f92f, Added iOS environment and test scriptCommit 22d6374ce7151ad0, Added Android and embedded environment and test script

您现在需要做的就是以下内容:

git clone https://github.com/weidai11/cryptopp.git
cd cryptopp

. ./setenv-ios.sh
make -f GNUmakefile-cross static dynamic cryptest.exe
...

新的/更新的文件将在下一个Crypto ++版本的ZIP中提供,它将是5.6.4或5.7.0。