link c library to magic