You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Thibault PIANA <pi...@gmail.com> on 2020/01/16 13:31:04 UTC

How to know Thrift version at compilation

Hello,

So, I'm not a rocket scientist when it comes to C++. I would like to
know a way to know the installed Thrift version and to stop the
compilation (Using pragmas I suppose) if the version doesn't match a
required one.

Do you know any way to do this easily ?

Regards


Re: How to know Thrift version at compilation

Posted by Randy Abernethy <ra...@rx-m.com>.
Hi,

Thrift versioning can be a little tricky. There's the Thrift Compiler
version, which matters because it generates the code that glues IDL
consumers to the Thrift Library. then there's the Thrift Library version,
the version of programming language specific support files installed on
your build system and (often) your runtime systems, (which could be
different!). So for C++ version info you have:

- Thrift Compiler Version (on build system): $ thrift --version
- Thrift Library Version (on build system): version in file name of .a and
.so
- Thrift Library Version (at runtime): version in file name of .so

For C++ the libraries you'll typically see a generic symlink to a versioned
lib file:
libthrift.so -> libthrift-0.9.2.so

Hope this helps. Others may have better ideas.

Best,
Randy



On Thu, Jan 16, 2020 at 5:31 AM Thibault PIANA <pi...@gmail.com>
wrote:

> Hello,
>
> So, I'm not a rocket scientist when it comes to C++. I would like to
> know a way to know the installed Thrift version and to stop the
> compilation (Using pragmas I suppose) if the version doesn't match a
> required one.
>
> Do you know any way to do this easily ?
>
> Regards
>
>

-- 

-- 
Randy Abernethy
Managing Partner
RX-M, LLCrandy.abernethy@rx-m.com
o 415-800-2922
c 415-624-6447