If gcc version < 4.7, omit --std=c++11 flag
Fix printf formatting warnings
Use malloc/free instead of new/delete for void* pointer in memory management to suppress warnings about deleting pointers without type information