Google APIs Client Library for C++ | A C++ library for client applications to access Google APIs. |
This page contains information about installing the Google APIs Client Library for C++.
Contents
System Requirements
- Operating systems:
- Linux
- Mac OS X
- More forthcoming
- Build Environment (for dependencies only):
The following tools are only used for installing the codebase to developer machines using the provided script.- Python
Used for the automated dependency library installation script
Also used to run a webserver for testing HTTP integration. These have been verified with Python version 2.6.4 and 2.7.3. cmake
The enclosed python script will download and installcmake
.
- Python
Obtaining the C++ Client
The C++ client libraries require some additional open source code packages.
The packaging includes a script to download these from source and another
to build them. You should also be able to use their prebuilt versions and
standard installations by skipping the
./prepare_dependencies.py
step.
tar xf googleapis-cpp_public.tar python ./prepare_dependencies.py ./external_dependencies/install/bin/cmake . make all test make export
The following options can be given to ./prepare_dependencies.py
:
- --download_dir=DownloadDir
- Changes the path to the directory to download and build the
dependency libraries.
This is an optional argument. The default value is./external_dependencies
. - --install_dir=InstallDir
- Changes the target directory path of the built dependency libraries and header files installation.
This is an optional argument. The default value is./external_dependencies/install
.- --force
- Forces the dependencies to be rebuilt and installed.
Normally the script remembers when a dependency has been successfully prepared and not attempt it next time.- -b
- Just build the dependencies. Do not download or install them.
Use this with --force if you want to force a re-build.- -d
- Just download the dependencies. Do not build them.
Use this with --force if you want to re-download them.- -i
- Just install the dependencies. Do not re-build them.
Use this with --force if you want to re-download them.- one or more package names
- You can process individual dependencies by just passing the names.
For the current list of names, see the ./prepare_dependencies.py script itself. - Changes the target directory path of the built dependency libraries and header files installation.
make export
creates a directory ./export
that has include
and lib subdirectories with
all the header files and libraries you need to compile and link your
applications against the libraries provided by
the Google APIs Client Library for C++.
If you are using your own IDE to write programs remember to:
- Add
-Ibuild_dir/export/include
to the C++ compiler flags in the libraries and programs that you create. - Add
-Lbuild_dir/export/lib
to the C++ linker flags for the C++ libraries and programs you link.
Get Started
The Jump In document provides a basic tutorial for writing your first client program using the Google APIs Client Library for C++. Source code samples are in the samples directory.