Obtaining and Installing the AMPS C / C++ Client
Last updated
Last updated
The AMPS C/C++ client is available as a download from the website. Download the client from the site, then install it on your development computer.
The client is packaged into a single file,amps-c++-client-<version>.tar.gz
, where is replaced by the
version of the client (such as amps-c++-client-5.3.0.zip
). In the
following examples, the version number is omitted from the filename.
Once expanded, the amps-c++-client
directory will be created,
containing sources, samples and makefiles for the C++ client. You’re
welcome to locate this directory anywhere that seems convenient; but for
the remainder of this book, we’ll simply refer to this directory as theamps-c++-client
directory.
The client is organized into a number of directories that you’ll be using through this book. Understanding this organization now will save you time in the future. The top level directories are:
Sources and makefile for the AMPS C++ client library.
Location of include
files for C and C++ programs. When building your
own program, you’ll add the include
directory to your include
path.
Getting started with a new C/C++ library can be challenging. For your reference, we provide a number of small samples, along with a makefile.
After unpacking the amps-c++-client
directory, you must build the
client library for your platform.
To build on Linux, change to the amps-c++-client
directory and, from a command prompt, type:
to make a static library, or
to make a shared object.
Before writing programs in AMPS, make sure connectivity to your AMPS development instance is working from your AMPS development environment.
Launch a terminal window and change the directory to the AMPS
directory in your AMPS installation and use spark
to test
connectivity to your server.
For example:
If spark
returns an error, verify that your AMPS server
is running and that there is no firewall blocking access
(including local firewalls between a host instance and
virtual machine or container).
Without connectivity to AMPS, you will be unable to make best use of this guide.