fix a bug for linking library