title: Boost Serialization compile error
body: <p>I am using netbeans to develop a simple c++ program that uses <code>boost serialization</code>.
  However when i try to compile the program i get a bunch of exceptions and errors:</p>
  
  <pre><code>CLEAN SUCCESSFUL (total time: 203ms)
  
  "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
  make[1]: Entering directory `/home/bernd/NetBeansProjects/LVAManager'
  "/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/lvamanager
  make[2]: Entering directory `/home/bernd/NetBeansProjects/LVAManager'
  mkdir -p build/Debug/GNU-Linux-x86
  rm -f build/Debug/GNU-Linux-x86/LVA.o.d
  g++    -c -g -I/usr/include/boost -MMD -MP -MF build/Debug/GNU-Linux-x86/LVA.o.d -o build/Debug/GNU-Linux-x86/LVA.o LVA.cpp
  mkdir -p build/Debug/GNU-Linux-x86
  rm -f build/Debug/GNU-Linux-x86/Manager.o.d
  g++    -c -g -I/usr/include/boost -MMD -MP -MF build/Debug/GNU-Linux-x86/Manager.o.d -o build/Debug/GNU-Linux-x86/Manager.o Manager.cpp
  mkdir -p build/Debug/GNU-Linux-x86
  rm -f build/Debug/GNU-Linux-x86/main.o.d
  g++    -c -g -I/usr/include/boost -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
  mkdir -p dist/Debug/GNU-Linux-x86
  g++     -o dist/Debug/GNU-Linux-x86/lvamanager build/Debug/GNU-Linux-x86/LVA.o build/Debug/GNU-Linux-x86/Manager.o build/Debug/GNU-Linux-x86/main.o 
  build/Debug/GNU-Linux-x86/main.o: In function `boost::archive::text_oarchive::text_oarchive(std::ostream&amp;, unsigned int)':
  /usr/include/boost/archive/text_oarchive.hpp:100: undefined reference to `boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::text_oarchive_impl(std::ostream&amp;, unsigned int)'
  build/Debug/GNU-Linux-x86/main.o: In function `boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::~text_oarchive_impl()':
  /usr/include/boost/archive/text_oarchive.hpp:85: undefined reference to `boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::~basic_text_oprimitive()'
  /usr/include/boost/archive/text_oarchive.hpp:85: undefined reference to `boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::~basic_text_oprimitive()'
  build/Debug/GNU-Linux-x86/main.o: In function `boost::archive::detail::common_oarchive&lt;boost::archive::text_oarchive&gt;::~common_oarchive()':
  /usr/include/boost/archive/detail/common_oarchive.hpp:35: undefined reference to `boost::archive::detail::basic_oarchive::~basic_oarchive()'
  build/Debug/GNU-Linux-x86/main.o:(.rodata._ZTIN5boost7archive6detail15common_oarchiveINS0_13text_oarchiveEEE[_ZTIN5boost7archive6detail15common_oarchiveINS0_13text_oarchiveEEE]+0x18): undefined reference to `typeinfo for boost::archive::detail::basic_oarchive'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::save_access::save_primitive&lt;boost::archive::text_oarchive, boost::archive::version_type&gt;(boost::archive::text_oarchive&amp;, boost::archive::version_type const&amp;)':
  /usr/include/boost/archive/detail/oserializer.hpp:87: undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::save_access::save_primitive&lt;boost::archive::text_oarchive, boost::archive::object_id_type&gt;(boost::archive::text_oarchive&amp;, boost::archive::object_id_type const&amp;)':
  /usr/include/boost/archive/detail/oserializer.hpp:87: undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::save_access::save_primitive&lt;boost::archive::text_oarchive, boost::archive::object_reference_type&gt;(boost::archive::text_oarchive&amp;, boost::archive::object_reference_type const&amp;)':
  /usr/include/boost/archive/detail/oserializer.hpp:87: undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::save_access::save_primitive&lt;boost::archive::text_oarchive, boost::archive::class_id_type&gt;(boost::archive::text_oarchive&amp;, boost::archive::class_id_type const&amp;)':
  /usr/include/boost/archive/detail/oserializer.hpp:87: undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::save_access::save_primitive&lt;boost::archive::text_oarchive, boost::archive::class_id_reference_type&gt;(boost::archive::text_oarchive&amp;, boost::archive::class_id_reference_type const&amp;)':
  /usr/include/boost/archive/detail/oserializer.hpp:87: undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
  build/Debug/GNU-Linux-x86/main.o:/usr/include/boost/archive/detail/oserializer.hpp:87: more undefined references to `boost::archive::detail::basic_oarchive::end_preamble()' follow
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::save&lt;boost::archive::object_id_type&gt;(boost::archive::object_id_type const&amp;)':
  /usr/include/boost/archive/text_oarchive.hpp:60: undefined reference to `boost::archive::basic_text_oarchive&lt;boost::archive::text_oarchive&gt;::newtoken()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::save&lt;boost::archive::object_reference_type&gt;(boost::archive::object_reference_type const&amp;)':
  /usr/include/boost/archive/text_oarchive.hpp:60: undefined reference to `boost::archive::basic_text_oarchive&lt;boost::archive::text_oarchive&gt;::newtoken()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::save&lt;boost::archive::class_id_type&gt;(boost::archive::class_id_type const&amp;)':
  /usr/include/boost/archive/text_oarchive.hpp:60: undefined reference to `boost::archive::basic_text_oarchive&lt;boost::archive::text_oarchive&gt;::newtoken()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::save&lt;boost::archive::class_id_reference_type&gt;(boost::archive::class_id_reference_type const&amp;)':
  /usr/include/boost/archive/text_oarchive.hpp:60: undefined reference to `boost::archive::basic_text_oarchive&lt;boost::archive::text_oarchive&gt;::newtoken()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::save&lt;boost::archive::tracking_type&gt;(boost::archive::tracking_type const&amp;)':
  /usr/include/boost/archive/text_oarchive.hpp:60: undefined reference to `boost::archive::basic_text_oarchive&lt;boost::archive::text_oarchive&gt;::newtoken()'
  build/Debug/GNU-Linux-x86/main.o:/usr/include/boost/archive/text_oarchive.hpp:60: more undefined references to `boost::archive::basic_text_oarchive&lt;boost::archive::text_oarchive&gt;::newtoken()' follow
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::save&lt;boost::archive::object_id_type&gt;(boost::archive::object_id_type const&amp;)':
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::save&lt;boost::archive::object_reference_type&gt;(boost::archive::object_reference_type const&amp;)':
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::save&lt;boost::archive::class_id_type&gt;(boost::archive::class_id_type const&amp;)':
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::save&lt;boost::archive::class_id_reference_type&gt;(boost::archive::class_id_reference_type const&amp;)':
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::save_access::save_primitive&lt;boost::archive::text_oarchive, std::string&gt;(boost::archive::text_oarchive&amp;, std::string const&amp;)':
  /usr/include/boost/archive/detail/oserializer.hpp:87: undefined reference to `boost::archive::detail::basic_oarchive::end_preamble()'
  /usr/include/boost/archive/detail/oserializer.hpp:88: undefined reference to `boost::archive::text_oarchive_impl&lt;boost::archive::text_oarchive&gt;::save(std::string const&amp;)'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::save&lt;boost::archive::tracking_type&gt;(boost::archive::tracking_type const&amp;)':
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::archive::basic_text_oprimitive&lt;std::ostream&gt;::save&lt;unsigned int&gt;(unsigned int const&amp;)':
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception::exception_code, char const*, char const*)'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/archive/basic_text_oprimitive.hpp:91: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  build/Debug/GNU-Linux-x86/main.o: In function `boost::archive::archive_exception::archive_exception(boost::archive::archive_exception const&amp;)':
  /usr/include/boost/archive/archive_exception.hpp:43: undefined reference to `vtable for boost::archive::archive_exception'
  /usr/include/boost/archive/archive_exception.hpp:43: undefined reference to `vtable for boost::archive::archive_exception'
  build/Debug/GNU-Linux-x86/main.o: In function `void boost::serialization::throw_exception&lt;boost::archive::archive_exception&gt;(boost::archive::archive_exception const&amp;)':
  /usr/include/boost/serialization/throw_exception.hpp:36: undefined reference to `boost::archive::archive_exception::~archive_exception()'
  /usr/include/boost/serialization/throw_exception.hpp:36: undefined reference to `typeinfo for boost::archive::archive_exception'
  collect2: error: ld returned 1 exit status
  make[2]: *** [dist/Debug/GNU-Linux-x86/lvamanager] Error 1
  make[2]: Leaving directory `/home/bernd/NetBeansProjects/LVAManager'
  make[1]: *** [.build-conf] Error 2
  make[1]: Leaving directory `/home/bernd/NetBeansProjects/LVAManager'
  make: *** [.build-impl] Error 2
  
  
  BUILD FAILED (exit value 2, total time: 4s)
  </code></pre>
  
  <p>I read that <code>boost serialization</code> is no header-only library.
  Has this something to do with this? <code>Netbeans</code> knows the boost library and gives me code assistance etc... But do i need to link it anyway?</p>
  
  <p>How can i link the library in <code>Netbeans</code>? where can i find it.
  I have a <code>debian</code> system and <code>libboost-all-dev</code> installed.</p>