blob: ad4cac4072ffbde6b6ffb359e829a2ea07e42f34 [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
42You MUST apply this patch to make generated code compile.
43https://issues.apache.org/jira/browse/THRIFT-1139
44
45Linking Against Thrift
46======================
47
48You need to link your project that uses thrift against all the thrift
Roger Meier878a9482011-10-11 19:02:37 +000049dependancies; in the case of libthrift, boost and for
Roger Meier84e4a3c2011-09-16 20:58:44 +000050libthriftnb, libevent.
51
52In the project properties you must also set HAVE_CONFIG_H as force include
53the config header: "windows/confg.h"
54
55Dependencies
56============
57
58boost shared pointers
59http://www.boost.org/libs/smart_ptr/smart_ptr.htm
60
Roger Meier878a9482011-10-11 19:02:37 +000061boost thread
62http://www.boost.org/doc/libs/release/doc/html/thread.html
63
Roger Meier84e4a3c2011-09-16 20:58:44 +000064libevent (for libthriftnb only)
65http://monkey.org/~provos/libevent/
66
Roger Meier878a9482011-10-11 19:02:37 +000067Notes on boost thread (static vs shared):
68=========================================
69
70By default lib/cpp/windows/force_inc.h defines:
71
72#define BOOST_ALL_NO_LIB 1
73#define BOOST_THREAD_NO_LIB 1
74
75This has for effect to have the host application linking against Thrift
76to have to link with boost thread as a static library.
77
78If you wanted instead to link with boost thread as a shared library,
79you'll need to uncomment those two lines, and recompile.
Roger Meier84e4a3c2011-09-16 20:58:44 +000080
81Known issues
82============
83
Roger Meier84e4a3c2011-09-16 20:58:44 +000084- Does not support named pipes. (Supported in unix through unix domain sockets).
85
86TODO
87====
88
89- Port remaining classes in libthrift:
Roger Meier84e4a3c2011-09-16 20:58:44 +000090 - TSSLSocket
91
92- Port test cases. (Not even started this. Run test cases in release mode?)
93
94- Autolink libraries depending on debug\release build.
95
96- Auto versioning.