开启 bulletproofs,编译时提示缺少 stpcpy,stpcpy((char *)p, V->name);
static int bp_stack_of_variable_encode(STACK_OF(BP_VARIABLE) *sk, unsigned char *out,
const EC_GROUP *group, BN_CTX *bn_ctx)
{
int i, n, *q, size;
size_t point_len;
unsigned char *p;
BP_VARIABLE *V;
if (sk == NULL || group == NULL)
return 0;
point_len = EC_POINT_point2oct(group, EC_GROUP_get0_generator(group),
form, NULL, 0, bn_ctx);
n = sk_BP_VARIABLE_num(sk);
if (out == NULL) {
size = sizeof(n) + n * point_len;
for (i = 0; i < n; i++) {
V = sk_BP_VARIABLE_value(sk, i);
if (V == NULL)
break;
if (V->name != NULL) {
size += strlen(V->name);
}
size += 1;
}
return size;
}
q = (int *)out;
*q++ = zkp_l2n((int)n);
p = (unsigned char *)q;
for (i = 0; i < n; i++) {
V = sk_BP_VARIABLE_value(sk, i);
if (V == NULL)
goto end;
if (EC_POINT_point2oct(group, V->point, form, p, point_len, bn_ctx) == 0)
goto end;
p += point_len;
if (V->name == NULL) {
*p++ = '\0';
continue;
}
stpcpy((char *)p, V->name);
p += strlen(V->name) + 1;
}
end:
return p - out;
}
环境:
Windows 2025
Visual Studio 2026
错误
libcrypto-shlib-bulletproofs_encode.obj : error LNK2019: unresolved external symbol stpcpy referenced in function bp_stack_of_variable_encode
开启 bulletproofs,编译时提示缺少 stpcpy,
stpcpy((char *)p, V->name);环境:
Windows 2025
Visual Studio 2026
错误