lxjiushiniu 2023-07-06 09:30 采纳率: 0%
浏览 67
已结题

Labview调用DLL库的问题


typedef struct
{
    int intElement;
    char* stringElement;
    int intElement1;
}test1;

typedef struct
{
    int nNum;
    test1* b;
}test2;

extern "C"{
    __declspec(dllexport) int __stdcall setNum(test2* clusterArray)
    {
        clusterArray->nNum = 2;
        for (int i = 0; i < clusterArray->nNum; i++) {

            clusterArray->b[i].stringElement = (char*)malloc(10 * sizeof(char));

            strcpy(clusterArray->b[i].stringElement, "Hello");

            clusterArray->b[i].intElement = i + 1;
        }
        return 1;
    }
}

类似这样的库函数,labview该如何设计呢?

或者

图片中的labview该怎么设计c库呢?

  • 写回答

8条回答 默认 最新

  • 技术宅program 2023-07-06 10:32
    关注
    获得0.90元问题酬金

    你需要确定你的c库是动态链接库(DLL)还是静态链接库(LIB)。labview可以调用DLL,但不能直接调用LIB。如果你的c库是LIB,你需要将它转换为DLL,或者使用一个包装器DLL来调用它

    评论

报告相同问题?

问题事件

  • 系统已结题 7月14日
  • 赞助了问题酬金15元 7月6日
  • 创建了问题 7月6日