By the way, if you are looking for basis pursuit denoising (or LASSO), most of the good machine learning libraries in C++ have their own implementation, e.g.:
I'd recommend using python as an alternative to Matlab instead of C++. It is as easy to use as Matlab, and many libraries provide an interface to python.
E.g. http://spams-devel.gforge.inria.fr/ provides sparse modeling in C++ but also with a python or R) binding.