undefined reference to boost::system:generic_category even though it exists in linker
<p>When I type <code>make</code> I get: </p>

<pre><code>Linking CXX executable ../../bin/MyProgram
../../lib/libMP.a(MPL.cpp.o): In function `_GLOBAL__sub_I_mult_fmm2':
MPL.cpp:(.text.startup+0x15): undefined reference to `boost::system::generic_category()'
MPL.cpp:(.text.startup+0x1a): undefined reference to `boost::system::generic_category()'
MPL.cpp:(.text.startup+0x1f): undefined reference to `boost::system::system_category()'
../../lib/libThing.a(vases.cpp.o): In function `_GLOBAL__sub_I__ZN9Thing6VasesC2ERKN3Two9DimensionENS1_8DataTypeE':
Vases.cpp:(.text.startup+0x15): undefined reference to `boost::system::generic_category()'
Vases.cpp:(.text.startup+0x1a): undefined reference to `boost::system::generic_category()'
Vases.cpp:(.text.startup+0x1f): undefined reference to `boost::system::system_category()'
</code></pre>

<p>...</p>

<pre><code>../../lib/libThing.a(HDF5_IO.cpp.o): In function     `Thing::HDF5_IO::createVolumeFile(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, Two::GenericBoundingBox&lt;double&gt; const&amp;, Two::Dimension const&amp;, std::vector&lt;Two::DataType, std::allocator&lt;Two::DataType&gt; &gt; const&amp;, unsigned int, unsigned int, double, double) const':
HDF5_IO.cpp:(.text+0x79c5): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&amp;, boost::system::error_code*)'
../../lib/libThing.a(HDF5_IO.cpp.o): In function `Thing::HDF5_IO::writeVolumeFile(Thing::Volume const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, unsigned int, unsigned int, unsigned long, unsigned long, unsigned long, bool) const':
HDF5_IO.cpp:(.text+0x97d1): undefined reference to `boost::thread::start_thread_noexcept()'
HDF5_IO.cpp:(.text+0x9b77): undefined reference to `boost::thread::join_noexcept()'
HDF5_IO.cpp:(.text+0x9fbb): undefined reference to `boost::thread::join_noexcept()'

...
</code></pre>

<p>and my <code>link.txt</code> file looks like</p>

<pre><code>/usr/bin/g++    -O3 -O3 -DNDEBUG   CMakeFiles/MyProject.dir/main.cpp.o      
-o ../../bin/MyProject  -L/home/myname/Desktop/MyProject/build/lib -rdynamic -lboost_thread-mt -lboost_date_time-mt -lboost_regex 
-lboost_filesystem-mt -lboost_program_options-mt ../../lib/libfftw3.a  -lxcb -lXau -lXext -lX11 -lpetsc -lmpich -lmpl -lrt ../../lib/libflapack.a 
-lgfortran ../../lib/libfblas.a -lgfortran ../../lib/libMyProjectAPI.a -lfftw3  -lGLU -lGL -lpthread ../../lib/libfftw3.a -lxcb -lXau -lX11 -lpetsc -lmpich -lmpl -lrt 
../../lib/libflapack.a -lgfortran ../../lib/libfblas.a -lgfortran ../../lib/libfblas.a -lpthread -lboost_thread-mt -lboost_date_time-mt -lboost_regex 
-lboost_filesystem-mt -lboost_system-mt     -lboost_program_options-mt /home/myname/anaconda2/lib/libhdf5.so /home/myname/anaconda2/lib/libhdf5_hl.so 
-lrt /home/myname/anaconda2/lib/libz.so -ldl -lm /home/myname/anaconda2/lib/libhdf5_cpp.so 
/home/myname/anaconda2/lib/libhdf5_hl_cpp.so /home/myname/anaconda2/lib/libhdf5.so /home/myname/anaconda2/lib/libhdf5_hl.so -lrt /home/myname/anaconda2/lib/libz.so 
-ldl -lm /home/myname/anaconda2/lib/libhdf5_cpp.so /home/myname/anaconda2/lib/libhdf5_hl_cpp.so -Wl,-rpath,/home/myname/Desktop/MyProject/build/lib:/home/myname/anaconda2/lib 
</code></pre>

<p>Anyone know how to solve this? If I replace <code>-lboost_system-mt</code> with <code>../../lib/libboost_system-mt.a</code> then I get the same error. And I see that in <code>/home/myname/Desktop/MyProject/build/lib</code> that <code>libboost_system-mt.a</code> clearly exists, so removing the <code>-mt</code> is not the problem. Anyone know how to solve this?</p>