Windows and Apache executables

I am testing how simple Apache Thrift should learn and it looks promising. One of the main problems: the first tutorial does not work ...

I have Windows 7, Python 2.7 and have Thrift.exe for Windows v.0.9.1. I would prefer not to compile from the source, as I am not using Cygwin, etc. The exe described the problems described below. So I switched and tried to use Chocolatey to install Thrift, using cinst Thrift which worked fine and gave me Thrift v0.9.0. But this version leads to the same behavior as exe described below.

When I run the tutorial found at http://thrift.apache.org/tutorial/py , I get the following:

C:\Users\Me\Desktop\Thrift>thrift -r --gen py tutorial.thrift
[WARNING:C:/Users/Me/Desktop/Thrift/tutorial.thrift:59] Could not find include file shared.thrift

[ERROR:C:/Users/Me/Desktop/Thrift/tutorial.thrift:123] (last token was 'shared.SharedService')
Service "shared.SharedService" has not been defined.

Hope exe works for someone because I would like to avoid this by requiring build from source.

+1
source share
2 answers

The answer is that the tutorial assumes that you have a folder / tutorial with two .thrift files included in it. If you follow the Windows EXE path and then create a tutorial.thrift file, you will add shared.thrift , which can be found in Git at https://git-wip-us.apache.org/repos/asf?p=thrift .git; a = blob_plain; f = tutorial / shared.thrift

Save this file next to your tutorial.thrift file and you can continue it.

+1
source

Team

thrift -r --gen py tutorial.thrift

-r[recurse] , IDL shared.thrift. shared.thrift , tutorial.thrift. Thrift , Thrift .

, Trrift C:\Thrift, thrift.exe , , :

C:\> cd Thrift\tutorial
C:\Thrift\tutorial> thrift.exe -r --gen py tutorial.thrift

PS: 0.9.0 . 0.9.1 , 0.9.2 .

0

Source: https://habr.com/ru/post/1538238/


All Articles