Thrift Compiler compilation steps

Source: Internet
Author: User

This article mainly introduces how to compile thrift compiler in windows + Visual Studio 2013, there are tutorials on thrift official website: http://thrift.apache.org/docs/BuildingFromSource, but some of the places in it are outdated, the provided flex and bison tool download links have also expired, so this article has made some preparations based on the original tutorial.

 

Step 1: use git to download thrift source code

Git clone https://git-wip-us.apache.org/repos/asf/thrift.git thrift

 

Step 2: Compile

  1. Download unixutil, flex.exeand bison.exe: http://unxutils.sourceforge.net/
    1. Decompress unixutil.zip to Directory.
    2. Add Directory A to the Path of the Windows environment variable. Note that adding is not A replacement.
  2. Set bison. simple
    1. Download bison. simple and put it in directory B.
    2. Define Windows environment variablesBISON_SIMPLE = directory B \ bison. simple
  3. Download inttypes. h and place it in thrift \ compiler \ cpp \ src \
  4. Generate source code
    1. Go to thrift \ compiler \ cpp \ and execute the following command line:
      Flex-osrc \ thriftl. cc src \ thriftl. ll

      Comment out # include <unistd. h> in the generated thriftl. cc.

    2. Continue execution:
      Bison-y-o "src/thrity. cc "-defines src/thrifle. yymove src \ thrifle. cc. hh src \ thrifle. hhmove src \ windows \ version. h. in src \ windows \ version. h

 

5. Use VS2013 to open thrift \ compiler \ cpp \ compiler. sln

6. Remove the content in BuildEvent from the project properties.

7. Compile the project. If everything goes well, you should be able to get the thrift.exe file.

 

Note: thrift has two files compiled (bison. simple and inttypes. h), which are hard to find. Download here: http://pan.baidu.com/s/1jGmmKqq

 

Thrift Compiler compilation steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.