首页 > 其他分享 >VC2010编译 thrift compiler

VC2010编译 thrift compiler

时间:2023-06-15 23:02:51浏览次数:47  
标签:thriftl src cc bison thrifty compiler VC2010 thrift


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.

标签:thriftl,src,cc,bison,thrifty,compiler,VC2010,thrift
From: https://blog.51cto.com/u_16162321/6495503

相关文章

  • rpcz VC2010 构建
    rpczVC2010构建rpcz是应用ZeroMQ和Protobuf开发的RPC.见:https://github.com/reinferio/rpcz及https://code.google.com/p/rpcz/rpcz的CMake脚本应该是仅用于Linux.用于VC需要更改错误。CMakeErroratD:/ProgramFiles/CMake2.8/share/cmake-2.8......
  • maven-compiler-plugin build-helper-maven-plugin Maven-assembly-plugin
    三个插件都是是用干啥的maven-compiler-plugin进行源代码的编译build-helper-maven-plugin项目中添加额外的资源、源代码、构建输出目录和依赖项等Maven-assembly-plugin生成可执行jar包<build><plugins><plugin><groupId......
  • error:java: compilation failed: internal java compiler error
    转自:https://xie.infoq.cn/article/537f575c166d556db9773002f java:Compilationfailed:internaljavacompilererror解决办法:1、查看项目的jdk(Ctrl+Alt+shift+S)File->ProjectStructure->ProjectSettings->Project2、查看工程的jdk(Ctrl+Alt+shift+S)File->Pr......
  • 【转载】configure: error: C compiler cannot create executables 错误解析
    1原文地址configure:error:Ccompilercannotcreateexecutables错误解析-to_be_better_wen-https://blog.csdn.net/to_be_better_wen/article/details/1306507742前言在编译开源软件的时候,有时会遇到"configure:error:Ccompilercannotcreateexecutables"的错......
  • compiler expression pattern match
     编译器中经常需要用到patternmatch。那么如何实现呢?比较直观的方法是使用递归。以patternmatch:y=a*(b+c)为例。首先,将其解析成一个抽象语法树:*a+bc其次,递归match:match(y,pattern)=>match(y,'*a+bc')左边是待检测的string,右边的是pattern。只要......
  • java反编译工具jd-gui和插件jd-eclipse,还有插件Enhanced Class Decompiler 3.3.0
    JD-GUI和JD-ECLIPSE可以直接在下面的网址进行下载http://java-decompiler.github.io/ (1)注意:JD-GUI.exe单机版有很多版本,有些旧版本反编译出来的源码和高版本反编译出来的源码是区别的1.低版本的反编译可能和实际源码有出入2.1.6.6版本反编译的源码中有中文无法正常复制? ......
  • 【Exception】maven-compiler-plugin 编译失败集锦
    1JDK明明是1.8为什么说编译环境和运行环境不一致?Whatfuck?JDK明明1.8为什么编译环境变成1.5了?Whatfuck?原因分析:奇怪的是我的机器上只安装了JDK8,为什么还会说不支持diamond和lambda呢?在Google大神的指引下,在MavenCompiler插件介绍里面找到了答案:Alsonotethat......
  • Thrift使用实例
    当然!这是三个使用Java实现的Thrift示例代码,用于演示Thrift的基本用法和通信模式:示例1:简单的服务端和客户端在此示例中,我们将创建一个简单的Thrift服务端和客户端,客户端向服务端发送请求并接收响应。Thrift定义文件(.thrift文件):namespacejavacom.example.thriftdemoservice......
  • 找不到“element-plus/global”的类型定义文件。 程序包含该文件是因为: 在 compilerO
    问题描述在tsconfig.json文件里types字段添加"element-plus/global"后出现报错。问题原因TS升级到5.x带来的规范性问题。可以通过npmviewtypescriptversion命令查看下你的TS版本。深层分析参考这篇:https://github.com/element-plus/element-plus/issues/12119问题解决1......
  • Thrift 大小端传输剖析
    说明libthrift\src\thrift\protocol\TProtocol.h文件宏定义__THRIFT_BYTE_ORDER定义了采样大端还是小端进行数据的传输该宏定义通过包含include<boost/detail/endian.hpp>来决定当前系统的字节序相关代码#ifdefHAVE_SYS_PARAM_H#include<sys/param.h>#endif#ifndef__THRIFT......