bug fixing, need to give libstdc++ lib path too for mac os x
fixed a memory bug