小编abh*_*ash的帖子

在macOS High Sierra上使用node-gyp动态链接wfdb库时,不会加载符号

我正在尝试创建一个依赖于WFDB库的动态库(https://www.physionet.org/physiotools/wfdb.shtml).我的c ++代码如下:

#include <stdio.h>
#include <iostream>
#include <vector>
#include <vector>
extern "C" {
    #include <wfdb/wfdb.h>
}

#include "./sample_wfdb.h"

int add(int a, int b){
    return a + b;
}

int read(){
    int i, nsig;
    WFDB_Siginfo* siarray;
    WFDB_Sample* v;
    nsig = isigopen("/data/100s", NULL, 0);
    if (nsig < 1)
        exit(1);
    siarray = (WFDB_Siginfo*)malloc(nsig * sizeof(WFDB_Siginfo));
    nsig = isigopen("data/100s", siarray, nsig);
    for (i = 0; i < nsig; i++)

        v = (WFDB_Sample*)malloc(nsig * sizeof(WFDB_Sample));

    if (v == NULL) {
        fprintf(stderr,"%s: insufficient memory\n"); …
Run Code Online (Sandbox Code Playgroud)

c++ dynamic-linking node.js missing-symbols node-gyp

6
推荐指数
1
解决办法
134
查看次数