Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 c++ 代码中打印 libssl 和 libnspr 的版本?我想打印在 header 和 library 中定义的版本。
头文件 opensslv.h #define 的宏变量 OPENSSL_VERSION_TEXT,描述了版本。例如“OpenSSL 0.9.8o-fips 01 Jun 2010”。
对于库本身,lib 文件的名称包含版本号。在 ubuntu 中,在文件夹 /lib/ 中,该文件名为 libssl.so.0.9.8。如果你愿意,你可以使用 boost::filesystem 来获取特定的文件名,然后解析它,也许使用 boost::regex。