开发者

how do you check your version of boost? [duplicate]

开发者 https://www.devze.com 2023-03-18 23:27 出处:网络
This question already has answers here: How to determine the Boost version on a system? (13 answers) Closed 9 years ago.
This question already has answers here: How to determine the Boost version on a system? (13 answers) Closed 9 years ago. 开发者_高级运维

I need to have my boost library in a version of 1.40. How do I check my version of the boost library?

I am trying to compile the PCL library, like described in http://pointclouds.org/downloads/source.html.


Well, take a look at your boost/version.hpp. There is BOOST_VERSION macro for that:

// Example: for boost 1.55.0, taken from boost/version.hpp
//  BOOST_VERSION % 100 is the patch level
//  BOOST_VERSION / 100 % 1000 is the minor version
//  BOOST_VERSION / 100000 is the major version
#define BOOST_VERSION 105500


#include <boost/version.hpp>
#include <iostream>

using namespace std;

int main()
{
    cout << "Boost version: " << BOOST_LIB_VERSION << endl;
    return 0;
}

Save the above code as a cpp file. example boost.cpp. Then compile it.

   $ g++ boost.cpp
   $ ./a.out
   Boost version: 1_55

Then you will get your boost library version displayed on your terminal. The example output is printed for Boost 1.55.0.

What Karl von Moor had said is also correct. Check this link to figure it out.

0

精彩评论

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