fix bugs for generate dynamic library.