VC2008编译libthrift

VC2008编译libthrift

(金庆的专栏)


thrift只提供了VC2010的sln文件。


用Project From Existing Code... 创建工程。
将 cpp/src/thrift 加入工程。

在Solution Explorer中,
去除 qt 目录。

添加 boost 包含目录。

添加 src 为包含目录,不然 #include <thrift/Thrift.h> 出错。

VC2008缺少 stdint.h, 创建到thrift/windows目录下,并添加为include目录。

#pragma once
#include <boost/cstdint.hpp>
typedef boost::int8_t int8_t;
...
typedef boost::uint64_t uint64_t;

#define INT8_MIN (-128)
...
#define UINT64_MAX (UINT64_C(18446...))

去除VC2010 thrift.sln中没有的文件,无法编译:
Mutex.cpp, PosixThreadFactory.cpp, Monitor.cpp
TEvhttpClientChannel.cpp TEvhttpServer.cpp
TServer.cpp TNonblockingServer.cpp
TSSLSocket.cpp TSSLServerSocket.cpp
TZlibTransport.cpp


加上宏 HAVE_CONFIG_H, 或者 force include force_inc.h.

windows/tr1/functional中
#include <functional>
改为
#include <boost/tr1/functional.hpp>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值