blob: f4c887cebfc07ecda3af6d96bea11df2fc707ae9 [file] [log] [blame]
Roger Meier84e4a3c2011-09-16 20:58:44 +00001Thrift C++ Software Library
2
3License
4=======
5
6Licensed to the Apache Software Foundation (ASF) under one
7or more contributor license agreements. See the NOTICE file
8distributed with this work for additional information
9regarding copyright ownership. The ASF licenses this file
10to you under the Apache License, Version 2.0 (the
11"License"); you may not use this file except in compliance
12with the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16Unless required by applicable law or agreed to in writing,
17software distributed under the License is distributed on an
18"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19KIND, either express or implied. See the License for the
20specific language governing permissions and limitations
21under the License.
22
23Using Thrift with C++
24=====================
25
26You need to define an enviroment variable called THIRD_PARTY. The project
27assumes that you have extracted the dependancies into their default structure
28into the path defined by THIRD_PARTY.
29
30e.g. $(THIRD_PARTY)/boost/boost_1_47_0/
31
32Thrift is divided into two libraries.
33
34libthrift
35 The core Thrift library contains all the core Thrift code. It requires
Roger Meier878a9482011-10-11 19:02:37 +000036 boost shared pointers and boost thread.
Roger Meier84e4a3c2011-09-16 20:58:44 +000037
38libthriftnb
39 This library contains the Thrift nonblocking server, which uses libevent.
40 To link this library you will also need to link libevent.
41
Roger Meier84e4a3c2011-09-16 20:58:44 +000042Linking Against Thrift
43======================
44
45You need to link your project that uses thrift against all the thrift
Roger Meier878a9482011-10-11 19:02:37 +000046dependancies; in the case of libthrift, boost and for
Roger Meier84e4a3c2011-09-16 20:58:44 +000047libthriftnb, libevent.
48
49In the project properties you must also set HAVE_CONFIG_H as force include
50the config header: "windows/confg.h"
51
52Dependencies
53============
54
55boost shared pointers
56http://www.boost.org/libs/smart_ptr/smart_ptr.htm
57
Roger Meier878a9482011-10-11 19:02:37 +000058boost thread
59http://www.boost.org/doc/libs/release/doc/html/thread.html
60
Roger Meier84e4a3c2011-09-16 20:58:44 +000061libevent (for libthriftnb only)
62http://monkey.org/~provos/libevent/
63
Roger Meier878a9482011-10-11 19:02:37 +000064Notes on boost thread (static vs shared):
65=========================================
66
67By default lib/cpp/windows/force_inc.h defines:
68
69#define BOOST_ALL_NO_LIB 1
70#define BOOST_THREAD_NO_LIB 1
71
72This has for effect to have the host application linking against Thrift
73to have to link with boost thread as a static library.
74
75If you wanted instead to link with boost thread as a shared library,
76you'll need to uncomment those two lines, and recompile.
Roger Meier84e4a3c2011-09-16 20:58:44 +000077
Roger Meier64af51b2012-02-06 20:46:06 +000078Windows version compatibility
79=============================
80The Thrift library targets Windows XP for broadest compatbility. A notable
81difference is in the Windows-specific implementation of the socket poll
82function. To target Vista, Win7 or other versions, comment out the line
83#define TARGET_WIN_XP.
84
Roger Meierd1bf5d02012-04-11 21:38:56 +000085Named Pipes
86===========
87- Named Pipe transport has been added in the TPipe and TPipeServer classes.
88 This is currently Windows-only (see below).
89
Roger Meier84e4a3c2011-09-16 20:58:44 +000090Known issues
91============
92
Roger Meierd1bf5d02012-04-11 21:38:56 +000093- Named pipe transport for *NIX has not been implemented. Domain sockets are
94 a better choice for local IPC under non-Windows OS's. *NIX named pipes
95 only support 1:1 client-server connection.
Roger Meier84e4a3c2011-09-16 20:58:44 +000096
97TODO
98====
99
100- Port remaining classes in libthrift:
Roger Meier84e4a3c2011-09-16 20:58:44 +0000101 - TSSLSocket
102
103- Port test cases. (Not even started this. Run test cases in release mode?)
104
105- Autolink libraries depending on debug\release build.
106
107- Auto versioning.