3

求教, Swift 引入 .a 库, 类型缺失?

 2 years ago
source link: https://www.v2ex.com/t/839053
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

求教, Swift 引入 .a 库, 类型缺失?

  liuidetmks · 5 小时 45 分钟前 · 173 次点击

最近想试试 swift ,干写没什么意思,想把以前写的小工具重写一下。
这不,遇到问题了,请各位巨佬稍微喵一眼,稍微点拨下,我就受用无穷了。

项目结构,如图: img

有主要有 3 个文件, 这里出问题的是 ecc.swift
这里原 oc 项目会调用一个 libsecp256k1 。a 的静态库,
搜索了下,说是 swift 必须把。a 封装成 。framework ,

好的,于是,我在工程下面添加一个 target , 编译成 framework
然后在 ecc.swift 中 import secp256k1 ,import 也没报错 ,但是也不能双击进入详情,
bridging header 也对应的设置了

但是使用头文件里面的类型时候,报错,Cannot find type 'secp256k1_context' in scope


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK