VC2008編譯libthrift
thrift只提供了VC2010的sln文件。
用Project From Existing Code... 創(chuàng)建工程。
將 cpp/src/thrift 加入工程。
在Solution Explorer中,
去除 qt 目錄。
添加 boost 包含目錄。
添加 src 為包含目錄,不然 #include <thrift/Thrift.h> 出錯(cuò)。
VC2008缺少 stdint.h, 創(chuàng)建到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中沒(méi)有的文件,無(wú)法編譯:
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>
(金慶的專欄)
thrift只提供了VC2010的sln文件。
用Project From Existing Code... 創(chuàng)建工程。
將 cpp/src/thrift 加入工程。
在Solution Explorer中,
去除 qt 目錄。
添加 boost 包含目錄。
添加 src 為包含目錄,不然 #include <thrift/Thrift.h> 出錯(cuò)。
VC2008缺少 stdint.h, 創(chuàng)建到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中沒(méi)有的文件,無(wú)法編譯:
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>