title: Waf - How to add a library to a wscript file?
body: <p>I would like to add the c++ library cpp-netlib to a wscript.
  Then if I run <code>dpkg -l libcppnetlib0</code> I obtain: </p>
  
  <pre><code>libcppnetlib0: 0.11.0-1     amd64        C++ Network Library
  </code></pre>
  
  <p>Running: <code>dpkg -L libcppnetlib0</code>, I obtain:</p>
  
  <pre><code>/.
  /usr
  /usr/lib
  /usr/lib/x86_64-linux-gnu
  /usr/lib/x86_64-linux-gnu/cppnetlib-uri.so.0.11.0
  /usr/lib/x86_64-linux-gnu/cppnetlib-server-parsers.so.0.11.0
  /usr/lib/x86_64-linux-gnu/cppnetlib-client-connections.so.0.11.0
  /usr/share
  /usr/share/lintian
  /usr/share/lintian/overrides
  /usr/share/lintian/overrides/libcppnetlib0
  /usr/share/doc
  /usr/share/doc/libcppnetlib0
  /usr/share/doc/libcppnetlib0/copyright
  /usr/share/doc/libcppnetlib0/changelog.Debian.gz
  /usr/lib/x86_64-linux-gnu/libcppnetlib-server-parsers.so.0
  /usr/lib/x86_64-linux-gnu/libcppnetlib-client-connections.so.0
  /usr/lib/x86_64-linux-gnu/libcppnetlib-uri.so.0
  </code></pre>
  
  <p>Since I need <code>libcppnetlib-uri, libcppnetlib-server-parsers, libcppnetlib-client-connections</code> , in the wscript I add the following fields:</p>
  
  <pre><code>conf.check_cxx(lib='cppnetlib-uri',uselib_store='CPPNETLIBU', define_name='HAVE_CPPNETLIBU',mandatory=True)
  conf.check_cxx(lib='cppnetlib-server-parsers',uselib_store='CPPNETLIBS', define_name='HAVE_CPPNETLIBS',mandatory=True)
  conf.check_cxx(lib='cppnetlib-client-connections',uselib_store='CPPNETLIBC', define_name='HAVE_CPPNETLIBC',mandatory=True)
  </code></pre>
  
  <p>Then I added the three references (CPPNETLIBU, CPPNETLIBC, CPPNETLIBS) here:</p>
  
  <pre><code>libndn_cxx = dict(
          target="ndn-cxx",
          name="ndn-cxx",
          source=bld.path.ant_glob('src/**/*.cpp',
                                   excl=['src/security/**/*-osx.cpp',
                                         'src/**/*-sqlite3.cpp']),
          headers='src/common-pch.hpp',
          use='version BOOST CRYPTOPP OPENSSL SQLITE3 RT PTHREAD CPPNETLIBC CPPNETLIBU CPPNETLIBS',
          includes=". src",
          export_includes="src",
          install_path='${LIBDIR}')
  </code></pre>
  
  <p>But, when I launch ./waf configure, it fails, it does not find the libraries that I specified.</p>
  
  <p>The error is: </p>
  
  <pre><code>[199/200] Linking build/examples/clientMat
  examples/clientMat.cpp.2.o: In function `construct&lt;boost::network::http::impl::normal_delegate, asio::io_service&amp;&gt;':
  /usr/include/c++/4.9/ext/new_allocator.h:120: undefined reference to `boost::network::http::impl::normal_delegate::normal_delegate(asio::io_service&amp;)'
  /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libcppnetlib-client-connections.so: undefined reference to `boost::system::system_category()'
  /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libcppnetlib-client-connections.so: undefined reference to `boost::system::generic_category()'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I (maybe?) identified the problem in the absence of any reference in /usr/local/lib/pkgconfig. Indeed, running: <code>ls /usr/local/lib/pkgconfig</code>, I have some <code>.pc</code> files but nothing about cppnetlib. I tried to write my own without success.</p>
  
  <p>If the problem is here, actually I need an help about how to write the <code>.pc</code> files correctly.</p>
  
  <p>This question was a good starting point, but I did not success the same: <a href="https://stackoverflow.com/questions/9016448/waf-how-to-add-external-library-to-wscript-build-file">waf -how to add external library to wscript_build file</a></p>