how do I set the LD_LIBRARY_PATH env variable?
You already set it when you did this:
But that will not solve your problem.
$LD_LIBRARY_PATH is consulted at time of execution, to provide a list of additional directories in which to search for dynamically linkable libraries. It is not consulted at link time (except maybe for locating libraries required by the built tools themselves!).
In order to tell the linker where to find libraries at build time, you need to use the
-L linker option. You already did that too:
If you are still getting the error, then you need to make sure that the library is actually there. Do you have a file
libboost_regex-mt.a in that (or any) directory? Note that a file like
libboost_regex-mt.so.othersuffix doesn't count for this purpose. If you don't have that, then you probably need to install your distribution's development package for this library.