building.md: Adding doc on building a simple example with g++ and using pkg-config

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll 2014-07-14 10:55:17 +01:00
parent 22ad93956c
commit d2e2682f0e

View File

@ -40,3 +40,20 @@ naming.
~~~~~~~~~~~~~
make _pyupm_i2clcd
~~~~~~~~~~~~~
Sometimes you want to build a small C++ example against an installed library.
This is fairly easy if installed systemwide. Just link against the correct
librar (in this case libupm-tm1637) and then add /usr/include/upm to the loader
path:
~~~~~~~~~~~~
g++ test.cxx -lupm_tm1637 -I/usr/include/upm
~~~~~~~~~~~~
You can also use pkg-config to return the information to you, which is
considered the correct way if including UPM in a build system like cmake or
autotools on linux.
~~~~~~~~~~~
pkg-config --cflags --libs upm-tm1637
~~~~~~~~~~~