From d2e2682f0eba6bbabeebbdae8d788aada470fcaf Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Mon, 14 Jul 2014 10:55:17 +0100 Subject: [PATCH] building.md: Adding doc on building a simple example with g++ and using pkg-config Signed-off-by: Brendan Le Foll --- docs/building.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/building.md b/docs/building.md index 2db8540..762e846 100644 --- a/docs/building.md +++ b/docs/building.md @@ -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 +~~~~~~~~~~~ -- 2.7.4