| OLD | NEW |
| 1 Protocol Buffers - Google's data interchange format | 1 Protocol Buffers - Google's data interchange format |
| 2 =================================================== | 2 =================================================== |
| 3 | 3 |
| 4 [](https
://travis-ci.org/google/protobuf) [](https://ci.appveyor.com/project/proto
buf/protobuf) | 4 [](https
://travis-ci.org/google/protobuf) [](https://ci.appveyor.com/project/proto
buf/protobuf) |
| 5 | 5 |
| 6 Copyright 2008 Google Inc. | 6 Copyright 2008 Google Inc. |
| 7 | 7 |
| 8 https://developers.google.com/protocol-buffers/ | 8 https://developers.google.com/protocol-buffers/ |
| 9 | 9 |
| 10 C++ Installation - Unix | 10 C++ Installation - Unix |
| 11 ----------------------- | 11 ----------------------- |
| 12 | 12 |
| 13 To build protobuf from source, the following tools are needed: |
| 14 |
| 15 * autoconf |
| 16 * automake |
| 17 * libtool |
| 18 * curl (used to download gmock) |
| 19 * make |
| 20 * g++ |
| 21 * unzip |
| 22 |
| 23 On Ubuntu, you can install them with: |
| 24 |
| 25 $ sudo apt-get install autoconf automake libtool curl make g++ unzip |
| 26 |
| 27 On other platforms, please use the corresponding package managing tool to |
| 28 install them before proceeding. |
| 29 |
| 13 If you get the source from github, you need to generate the configure script | 30 If you get the source from github, you need to generate the configure script |
| 14 first: | 31 first: |
| 15 | 32 |
| 16 $ ./autogen.sh | 33 $ ./autogen.sh |
| 17 | 34 |
| 18 This will download gmock source (which is used for C++ Protocol Buffer | 35 This will download gmock source (which is used for C++ Protocol Buffer |
| 19 unit-tests) to the current directory and run automake, autoconf, etc. | 36 unit-tests) to the current directory and run automake, autoconf, etc. |
| 20 to generate the configure script and various template makefiles. | 37 to generate the configure script and various template makefiles. |
| 21 | 38 |
| 22 You can skip this step if you are using a release package (which already | 39 You can skip this step if you are using a release package (which already |
| 23 contains gmock and the configure script). | 40 contains gmock and the configure script). |
| 24 | 41 |
| 25 To build and install the C++ Protocol Buffer runtime and the Protocol | 42 To build and install the C++ Protocol Buffer runtime and the Protocol |
| 26 Buffer compiler (protoc) execute the following: | 43 Buffer compiler (protoc) execute the following: |
| 27 | 44 |
| 28 $ ./configure | 45 $ ./configure |
| 29 $ make | 46 $ make |
| 30 $ make check | 47 $ make check |
| 31 $ make install | 48 $ sudo make install |
| 49 $ sudo ldconfig # refresh shared library cache. |
| 32 | 50 |
| 33 If "make check" fails, you can still install, but it is likely that | 51 If "make check" fails, you can still install, but it is likely that |
| 34 some features of this library will not work correctly on your system. | 52 some features of this library will not work correctly on your system. |
| 35 Proceed at your own risk. | 53 Proceed at your own risk. |
| 36 | 54 |
| 37 "make install" may require superuser privileges. | 55 For advanced usage information on configure and make, please refer to the |
| 56 autoconf documentation: |
| 38 | 57 |
| 39 For advanced usage information on configure and make, see INSTALL.txt. | 58 http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Sc
ripts |
| 40 | 59 |
| 41 **Hint on install location** | 60 **Hint on install location** |
| 42 | 61 |
| 43 By default, the package will be installed to /usr/local. However, | 62 By default, the package will be installed to /usr/local. However, |
| 44 on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. | 63 on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH. |
| 45 You can add it, but it may be easier to just install to /usr | 64 You can add it, but it may be easier to just install to /usr |
| 46 instead. To do this, invoke configure as follows: | 65 instead. To do this, invoke configure as follows: |
| 47 | 66 |
| 48 ./configure --prefix=/usr | 67 ./configure --prefix=/usr |
| 49 | 68 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 168 |
| 150 Compile using the IBM xlC C++ compiler as follows: | 169 Compile using the IBM xlC C++ compiler as follows: |
| 151 | 170 |
| 152 ./configure CXX=xlC | 171 ./configure CXX=xlC |
| 153 | 172 |
| 154 Also, you will need to use GNU `make` (`gmake`) instead of AIX `make`. | 173 Also, you will need to use GNU `make` (`gmake`) instead of AIX `make`. |
| 155 | 174 |
| 156 C++ Installation - Windows | 175 C++ Installation - Windows |
| 157 -------------------------- | 176 -------------------------- |
| 158 | 177 |
| 159 If you are using Microsoft Visual C++, see cmake/README.md. | 178 If you only need the protoc binary, you can download it from the release |
| 179 page: |
| 160 | 180 |
| 161 If you are using Cygwin or MinGW, follow the Unix installation | 181 https://github.com/google/protobuf/releases |
| 182 |
| 183 In the downloads section, download the zip file protoc-$VERSION-win32.zip. |
| 184 It contains the protoc binary as well as public proto files of protobuf |
| 185 library. |
| 186 |
| 187 To build from source using Microsoft Visual C++, see [cmake/README.md](../cmake/
README.md). |
| 188 |
| 189 To build from source using Cygwin or MinGW, follow the Unix installation |
| 162 instructions, above. | 190 instructions, above. |
| 163 | 191 |
| 164 Binary Compatibility Warning | 192 Binary Compatibility Warning |
| 165 ---------------------------- | 193 ---------------------------- |
| 166 | 194 |
| 167 Due to the nature of C++, it is unlikely that any two versions of the | 195 Due to the nature of C++, it is unlikely that any two versions of the |
| 168 Protocol Buffers C++ runtime libraries will have compatible ABIs. | 196 Protocol Buffers C++ runtime libraries will have compatible ABIs. |
| 169 That is, if you linked an executable against an older version of | 197 That is, if you linked an executable against an older version of |
| 170 libprotobuf, it is unlikely to work with a newer version without | 198 libprotobuf, it is unlikely to work with a newer version without |
| 171 re-compiling. This problem, when it occurs, will normally be detected | 199 re-compiling. This problem, when it occurs, will normally be detected |
| 172 immediately on startup of your app. Still, you may want to consider | 200 immediately on startup of your app. Still, you may want to consider |
| 173 using static linkage. You can configure this package to install | 201 using static linkage. You can configure this package to install |
| 174 static libraries only using: | 202 static libraries only using: |
| 175 | 203 |
| 176 ./configure --disable-shared | 204 ./configure --disable-shared |
| 177 | 205 |
| 178 Java and Python Installation | |
| 179 ---------------------------- | |
| 180 | |
| 181 The Java and Python runtime libraries for Protocol Buffers are located | |
| 182 in the java and python directories. See the README file in each | |
| 183 directory for more information on how to compile and install them. | |
| 184 Note that both of them require you to first install the Protocol | |
| 185 Buffer compiler (protoc), which is part of the C++ package. | |
| 186 | |
| 187 Usage | 206 Usage |
| 188 ----- | 207 ----- |
| 189 | 208 |
| 190 The complete documentation for Protocol Buffers is available via the | 209 The complete documentation for Protocol Buffers is available via the |
| 191 web at: | 210 web at: |
| 192 | 211 |
| 193 https://developers.google.com/protocol-buffers/ | 212 https://developers.google.com/protocol-buffers/ |
| OLD | NEW |