title: ROS Linking errors using boost::filesystem library using C++ under linux
body: <p>I get the following errors:</p>
  
  <pre><code>CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `boost::filesystem3::path::codecvt()':
  /usr/include/boost/filesystem/v3/path.hpp:377: undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `directory_iterator':
  /usr/include/boost/filesystem/v3/operations.hpp:594: undefined reference to `boost::filesystem3::detail::directory_iterator_construct(boost::filesystem3::directory_iterator&amp;, boost::filesystem3::path const&amp;, boost::system::error_code*)'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `boost::filesystem3::path::codecvt()':
  /usr/include/boost/filesystem/v3/path.hpp:377: undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `path&lt;boost::filesystem3::directory_entry&gt;':
  /usr/include/boost/filesystem/v3/path.hpp:134: undefined reference to `boost::filesystem3::path_traits::dispatch(boost::filesystem3::directory_entry const&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;, std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;)'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `is_directory':
  /usr/include/boost/filesystem/v3/operations.hpp:223: undefined reference to `boost::filesystem3::detail::status(boost::filesystem3::path const&amp;, boost::system::error_code*)'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `boost::iterator_facade&lt;boost::filesystem3::directory_iterator, boost::filesystem3::directory_entry, boost::single_pass_traversal_tag, boost::filesystem3::directory_entry&amp;, int&gt;::operator++()':
  /usr/include/boost/filesystem/v3/operations.hpp:630: undefined reference to `boost::filesystem3::detail::directory_iterator_increment(boost::filesystem3::directory_iterator&amp;, boost::system::error_code*)'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `boost::filesystem3::path::codecvt()':
  /usr/include/boost/filesystem/v3/path.hpp:377: undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `is_directory':
  /usr/include/boost/filesystem/v3/operations.hpp:223: undefined reference to `boost::filesystem3::detail::status(boost::filesystem3::path const&amp;, boost::system::error_code*)'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `~dir_itr_imp':
  /usr/include/boost/filesystem/v3/operations.hpp:563: undefined reference to `boost::filesystem3::detail::dir_itr_close(void*&amp;, void*&amp;)'
  /usr/include/boost/filesystem/v3/operations.hpp:563: undefined reference to `boost::filesystem3::detail::dir_itr_close(void*&amp;, void*&amp;)'
  CMakeFiles/ndt_visualiser.dir/src/fromFile.o: In function `__static_initialization_and_destruction_0':
  /usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
  /usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
  /usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
  </code></pre>
  
  <p>I've seen quite a few posts with similar errors. In pretty much all of those posts (e.g. <a href="https://stackoverflow.com/questions/1408619/problem-linking-boost-library-in-linux">Linking Boost Library in Linux</a>) it seems the solution is, that you need to add the -lboost_filesystem and -lboost_system flags. I've tried adding these as lflags or cflags to the manifest.xml, but that changes absolutely nothing. And I've tried adding something to the CMakeLists.txt of my package, but I guess I was doing that wrong.</p>
  
  <p>So any ideas?</p>