gpt4 book ai didi

version - 如何从 C++ 程序中检索 Poco 库版本?

转载 作者:行者123 更新时间:2023-12-04 13:21:01 25 4
gpt4 key购买 nike

C++ Poco 库在返回库当前版本的源代码中是否有任何宏或常量?

最佳答案

Poco::Environment 类有一个静态成员函数libraryVersion():

#include "Poco/Environment.h"
#include "Poco/Format.h"

// ...

std::string version = Poco::format("%d.%d.%d",
static_cast<int>(Poco::Environment::libraryVersion() >> 24),
static_cast<int>((Poco::Environment::libraryVersion() >> 16) & 0xFF),
static_cast<int>((Poco::Environment::libraryVersion() >> 8) & 0xFF));

取值自Poco/Version.h中的POCO_VERSION宏:

// Version format is 0xAABBCCDD, where
// - AA is the major version number,
// - BB is the minor version number,
// - CC is the patch version number, and
// - DD is the pre-release designation/number.
// The pre-release designation hex digits have a special meaning:
// 00: final/stable releases
// Dx: development releases
// Ax: alpha releases
// Bx: beta releases
//
#define POCO_VERSION 0x01090000

关于version - 如何从 C++ 程序中检索 Poco 库版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52647662/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com