thrift环境搭建
rpc请求thrift 环境搭建
背景
负责的项目由http请求转为thrift请求,需要搭建 thrift环境,node端处理thrift请求打到后端
搭建
1 | brew install boost |
1 | ./bootstrap.sh |
1、如果pkg-config 没有安装,会如下错误“./configure: line 16976: syntax error near unexpected token `QT,’”
2、出现 fatal error: ‘openssl/opensslv.h’ file not found,需要在configure 中指定 openssl 的查找路径 ./configure LDFLAGS=’-L/usr/local/opt/openssl/lib’ CPPFLAGS=’-I/usr/local/opt/openssl/include’
1 | thrift -r --gen js:node my_file.thrift |
备注
1、mac权限问题需要加sudo
2、bison安装出错参考 https://stackoverflow.com/questions/31805431/how-to-install-bison-on-mac-osx