Compiling unit gives ld error