For the statistical part of your question, look in the /src folder of the .tar.gz file here. You'll find pointers to a selection of papers in the manual (pdf file in the same link). This package is a collection of existing real time version (i.e. amortized cost of O(1)) of all state of the art uni-variate outlier detection procedures. I'm not involved in it, but i can't recommend it enough.
For the licensing part of your problem, you may have a look here.
For most of these algorithm, the codes in that package are the only cpp
implementations of these procedures i know of. Without knowing what the
terms of the R licences are, i suppose you could still use the codes
there to test them and re-implement your preferred ones under your own
terms.