开发者

How to print libssl and libnspr version from c++ code?

开发者 https://www.devze.com 2023-04-08 15:45 出处:网络
How can I print the version of libssl and libnsprin c++ code ? I want to print version for both define开发者_运维问答d in header and library . The header file opensslv.h #define \'s the macro variable

How can I print the version of libssl and libnspr in c++ code ? I want to print version for both define开发者_运维问答d in header and library .


The header file opensslv.h #define 's the macro variable OPENSSL_VERSION_TEXT, describing the version. For instance "OpenSSL 0.9.8o-fips 01 Jun 2010".

For the library itself, the name of the lib file contains the version number. In ubuntu, in the folder /lib/, the file is called libssl.so.0.9.8. If you felt like it, you could use boost::filesystem to grab the particular filename and then parse it, perhaps using boost::regex.

0

精彩评论

暂无评论...
验证码 换一张
取 消