new version supporting linking to external libraries.