48

I just want to know how I can find the version of boost installed in my ubuntu 12.04? I am having trouble with the current precise and thinking of reverting back to 8.04. What is the boost version in 8.04?

1
  • What specific error are you having? You may find help for it at stackoverflow.com
    – NoBugs
    Jun 7, 2012 at 1:29

3 Answers 3

65

The version of libboost on my 12.04 system is 1.48.0.2. Here's how you can find out:

dpkg -s libboost-dev | grep 'Version'
1
  • 1
    This method work only if you installed it properly. If you install the boost manually, you will get something like: dpkg-query: package 'libboost-dev' is not installed and no information is available Use dpkg --info (= dpkg-deb --info) to examine archive files, and dpkg --contents (= dpkg-deb --contents) to list their contents.
    – Kemin Zhou
    Feb 18, 2020 at 0:07
24

You can check version.hpp inside Boost include dir (normally /usr/include/boost, you can use locate /boost/version.hpp or similar to get that) for BOOST_VERSION or BOOST_LIB_VERSION.

$ cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"

//  BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
#define BOOST_LIB_VERSION "1_53"

SO: How to determine the Boost version on a system?

1
  • 3
    Also check /usr/local/include/boost/version.hpp. I found a higher version of boost there. 1_62 vs 1_58
    – smac89
    Aug 18, 2017 at 3:19
2

In the C++ source file!

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

int main() {
  std::cout << BOOST_LIB_VERSION << '\n';
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.