英文:
using wolfssl mp_init() ,undefined reference to 'sp_init'
问题
#include <stdlib.h>
#include <unistd.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/sp.h>//cannot to include,why?
#include <wolfssl/wolfcrypt/sp_int.h>
using namespace std;
int main(int argc, char* arfv[]) {
mp_int k;
mp_init(&k);
return 0;
}
I have configured the environment. Without mp_init(&k)
, it can be compiled. I didn't find how to use mp_int
in the WolfSSL document.
I didn't find how to use mp_int
in the WolfSSL document. I want to know how to use mp_init
and mp_int
to calculate in WolfSSL.
<details>
<summary>英文:</summary>
#include <stdlib.h>
#include <unistd.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/sp.h>//cannot to include,why?
#include <wolfssl/wolfcrypt/sp_int.h>
using namespace std;
int main(int argc, char* arfv[]) {
mp_int k;
mp_init(&k);
return 0;
}
I have configured the environment.without `mp_init(&k)`, it can be compiled. I didn't find how to use mp_int in wolfssl document
I didn't find how to use mp_int in wolfssl document.i want to know how to use mp_init and mp_int to calculate in wolfssl
</details>
# 答案1
**得分**: 0
为了直接使用MP API,您需要配置库以使用配置定义`WOLFSSL_PUBLIC_MP`将它们公开。
以下是示例链接:
https://github.com/wolfSSL/wolfssl-examples/blob/master/ecc/ecc-params.c
<details>
<summary>英文:</summary>
@zihao wang
In order to use the MP API directly, you'll need to configure the library to expose them as public using the configuration define `WOLFSSL_PUBLIC_MP`
Here is an example:
https://github.com/wolfSSL/wolfssl-examples/blob/master/ecc/ecc-params.c
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论