How to determine the Boost version on a system?

前端 未结 12 2206
暖寄归人
暖寄归人 2020-12-04 07:46

Is there a quick way to determine the version of the Boost C++ libraries on a system?

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 07:55

    I stugeled to find out the boost version number in bash.

    Ended up doing following, which stores the version code in a variable, supressing the errors. This uses the example from maxschlepzig in the comments of the accepted answer. (Can not comment, don't have 50 Rep)

    I know this has been answered long time ago. But I couldn't find how to do it in bash anywhere. So I thought this might help someone with the same problem. Also this should work no matter where boost is installed, as long as the comiler can find it. And it will give you the version number that is acutally used by the comiler, when you have multiple versions installed.

    {
    VERS=$(echo -e '#include \nBOOST_VERSION' | gcc -s -x c++ -E - | grep "^[^#;]")
    } &> /dev/null
    

提交回复
热议问题