how to get the library version information
Closed this issue · 2 comments
rossanoparis commented
Perhaps I didn't look carefully, but I was not able to find a way to to get the library version information from source code.
sammycage commented
This feature has been added in the latest commit. Here's a concise example demonstrating the use of both LUNASVG_VERSION_STRING
and LUNASVG_VERSION_ENCODE
:
#include <iostream>
#include <lunasvg.h>
int main() {
std::cout << "LunaSVG version: " << LUNASVG_VERSION_STRING << std::endl;
if (LUNASVG_VERSION > LUNASVG_VERSION_ENCODE(2, 3, 0)) {
std::cout << "Current version is newer than 2.3.0" << std::endl;
}
return 0;
}
This example prints the current version string and checks if the current version is newer than 2.3.0
.