wolfssl之xcode链接库配置

        wolfssl已经装了好些天了,今天发现在wolfssl自带的文件内有个IDE文件夹,里面能支持xcode,还提供了xcode的project文件和workspace文件,如下图:


     

            我看了 README.md文件,文件首先介绍了该目录下包含的五个文件:

                 1. `wolfssl.xcworkspace` -- workspace with library and testsuite client

                 2. `wolfssl_testsuite.xcodeproj` -- project to run the testsuite.

                 3. `wolfssl.xcodeproj` -- project to build OS/x and iOS libraries for wolfSSL and/or wolfCrypt

                 4. `wolfssl-FIPS.xcodeproj` -- project to build wolfSSL and wolfCrypt-FIPS if available

                 5. `user_settings.h` -- custom library settings, which are shared across projects


            然后是workspace的相关链接:

                  For the library and testsuite to link properly the build location needs to be configured as realitive to workspace.

                  1. File -> Workspace Settings (or Xcode -> Preferences -> Locations -> Locations)

                  2. Derived Data -> Advanced

                  3. Custom -> Relative to Workspace

                  4. Products -> Build/Products


           还有就是如果你想用xcode与处理器的话,就进行以下步骤:

                  If needed the Xcode preprocessors can be modifed with these steps:

                  1. Click on the Project in "Project Navigator".

                  2. Click on the "Build Settings" tab.

                  3. Scroll down to the "Apple LLVM 6.0 - Preprocessing" section.

                  4. Open the disclosure for "Preprocessor Macros" and use the "+" and "-" buttons to modify. Remember to do this for both Debug and Release.


           这一步步进行下来也没遇到什么麻烦,下图是我在build settings 对 search paths 中 framework search path、header search path 和 library search path 这三项添加了我wolfssl 的根目录地址,就是下图中  /Users/QY/Downloads/wolfssl-master  。 



           进行到这一步,改好查找路径后,编辑代码时出现的 “#include <wolfssl/wolfcrypt/aes.h> file not found” 之类的错误就都解决了。

            但是,编译后xcode还是报错,截图如下:


           google了一下,并没有找到有效的解决方式

           于是,继续看readme文件,发现里面提到一个叫libwolfssl.a的文件,文档原文如下:

                 # Building libwolfssl.a

                  There are several options of builds. You can make a simulator build, or adevice build. Both are debug builds.

                  You can make an archive for a device, as well. That is a release build.

                 # Installing libwolfssl.a

                  Simply drag the file libwolfssl_XXX_.a and the directory `include` and drop it into your project file list pane where it makes sense for you. Allow it to copy the files over to the project directory. This should automatically add the library to the list of libraries to link against.

          然后我就开始找这个libwolfssl.a文件,在/wolfssl-master/IDE/iOS/Build/Products下找到了,然后把这个文件添加到代码里面,再编译就通过了。


          刚开始学wolfssl,在百度上找到的资料实在有限,只能通过Google搜,但是学习资料还是少的可怜,只能看看manual 看官方文档一点点慢慢摸索学习,记录下自己遇到的问题和解决的办法,希望自己能一点一点成长。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值