Updated dynamic library code to work with g++