fixed warning and added finding size of each file
fixed magic.h lib linking and modified CMakeLists.txt