fix error when compile with cpp