About thrift documentation is really bad. Groped for a long time to finally successfully complete the configuration across Linux and Windows across C + + and Python languages. Here are the steps:
1) environment configuration under Linux
L Complete installation of other packages that thrift depends on: Boost, Libtool, libevent, bison, Flex
- Unzip the boost_1_55_0 and enter the BOOST_1_55_0 directory
- chmod 777 bootstrap.sh
- chmod 777./tools/build/v2/engine/build.sh
- ./bootstrap.sh
- Go to the libtool-1.3.5 directory
- Make
- Go to the Libevent-2.0.21-stable directory
- Make
- Go to the bison-3.0 directory
- Make
(not installing these dependent packages will always prompt the failure, but also drunk, I can not rule out what is necessary, therefore all written)
L Thrift Installation
- Unzip Thrift compressed file: Tar zxvf thrift-0.9.1.tar.gz
- Go to the thrift-0.9.1 directory
- ./configure
- Make
- sudo make install
- Thrift–version
- Successful display of Thrift version installation succeeded
(Be sure to show the thrift version is not successful install, if not say the previous installation has a problem OH)
L WRITE the. thrift file and generate the intermediate file
L Compile
- Thrift–r–gen CPP Tutorial.thritft
- Make compilation generates tutorialserver,tutorialclient two executables (we use only the server side)
2) Environment Configuration under window
L Decompression thrift-0.9.1.tar.gz
- Installing the Thrift Library
Python setup.py Install
- Thrift Generating Code
Use the downloaded good thrift-0.9.1.exe to execute commands in the Thrift-0.9.1\tutorial directory
Thrift-0.9.1.exe–r–gen py Tutorial.thrift
Generate the Gen-py folder in the current folder
3) Run
Linux Service side:
Windows Client :
The final Linux server is shown below
Success,
Thrift Server Linux C + + with client Windows Python environment configuration (thrift with tutorial as an example)