输出openni版本号

在openni中,其版本号由四个数字组成,以一个struct的形式来实现:如下

typedef struct
{
	/** Major version number, incremented for major API restructuring. */
	int major;
	/** Minor version number, incremented when significant new features added. */
	int minor;
	/** Maintenance build number, incremented for new releases that primarily provide minor bug fixes. */
	int maintenance;
	/** Build number. Incremented for each new API build. Generally not shown on the installer and download site. */
	int build;
} Version;
major.minor.maintenance.build
#include <iostream>
#include "OpenNI.h"

int main()
{
	openni::Status result = openni::STATUS_OK;
	result = openni::OpenNI::initialize();
	if (result == openni::STATUS_OK)
	{
		openni::Version version = openni::OpenNI::getVersion();
		std::cout << version.minor << "."
				<< version.major << "."
				<< version.maintenance << "."
				<< version.build 
				<< std::endl;

	}
	openni::OpenNI::shutdown();
	system("pause");
	return 0;
}

我用的版本是openni 最新版2.2.0.32,四个数字分别对应

那么在程序中得到版本号呢?代码如下:

#include <iostream>
#include "OpenNI.h"

int main()
{
	openni::Status result = openni::STATUS_OK;
	result = openni::OpenNI::initialize();
	if (result == openni::STATUS_OK)
	{
		openni::Version version = openni::OpenNI::getVersion();
		std::cout << version.major << "."
				<< version.minor << "."
				<< version.maintenance << "."
				<< version.build 
				<< std::endl;

	}
	openni::OpenNI::shutdown();
	system("pause");
	return 0;
}





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值