VC2010编译 thrift compiler

VC2010编译 thrift compiler


需flex, bison.
bison依赖m4, regex.

Pre-Build event 中 flex 命令有误,-o与参数间不应该有空格。

flex -o"src\\thriftl.cc" src/thriftl.ll
bison -y -o "src\thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy

compiler\cpp\src\thriftl.cc(26): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
需手工处理。

http://svn.apache.org/repos/asf/thrift/attic/trunk/compiler/cpp/README_Windows.txt

Building the Thrift IDL compiler in Windows
-------------------------------------------

The Visual Studio project contains pre-build commands to generate the
thriftl.cc, thrifty.cc and thrifty.h files which are necessary to build
the compiler. These depend on bison, flex and their dependencies to
work properly. If this doesn't work on a system, try these manual
pre-build steps.

Open compiler.sln and remove the Pre-build commands under the project's
 Properties -> Build Events -> Pre-Build Events.

Download flex & bison from http://jaisantonyk.wordpress.com/2008/03/16/lex-and-yaccbison-in-windows/
Download bison.simple in addition to bison.exe . This build of bison is easier to use
than the one on sourceforge which has a myriad of dependencies.
Place these binaries somewhere in the path.

From a command prompt:
> cd thrift/compiler/cpp
> flex -osrc\thriftl.cc src\thriftl.ll
In the generated thriftl.cc, comment out #include <unistd.h>

Place a copy of bison.simple in thrift/compiler/cpp
> bison -y -o "src/thrifty.cc" --defines src/thrifty.yy
> move src\thrifty.cc.h  src\thrifty.h

Download inttypes.h from the interwebs and place it in an include path
location (e.g. thrift/compiler/cpp/src).

Build the compiler in Visual Studio.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值