---
title: kupl_get_version
description: "获取KUPL产品版本信息。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/KunpengHPCKit_developer_116.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/KunpengHPCKit_developer_116.html
indexId: 49b3a8401d758451696badc2ff4b5401e15e46fd489077df46b99c2be1bb35c067
---
# kupl_get_version

获取KUPL产品版本信息。

#### 接口定义

int kupl_get_version(kupl_version_t *version)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| version | 产品信息结构体。 | 非空 | 输出 |


#### 返回值

- 成功：返回KUPL_OK
- 失败：返回KUPL_ERROR


#### 示例

```
#include <stdio.h>
#include "kupl.h"

int main()
{
    kupl_version_t version;
    int status = kupl_get_version(&version);
    printf("product_name = %s\n", version.product_name);
    printf("product_version = %s\n", version.product_version);
    printf("component_name = %s\n", version.component_name);
    printf("component_abi_version = %s\n", version.component_abi_version);
    printf("component_version = %s\n", version.component_version);
    printf("component_appendinfo = %s\n", version.component_appendinfo);
    return 0;
}
```


运行结果：

```
product_name = Kunpeng HPCKit
product_version = 26.1.RC1
component_name = KUPL
component_abi_version = 1
component_version = 26.1.RC1
component_appendinfo = gcc
```

以上版本号和编译时间以实际运行结果为准，上述结果仅供参考。
