shared library object, will handle allocations and errors