This doesn't compile in Lazarus, because DeleteFile expects pchar instead of a string, and FindClose expects a longword instead of TSearchRec.Remove Windows from uses or move it before SysUtils.
Does the last unit in the uses clause take priority? I still haven't completed compiling and I'm no longer getting errors, but I hovered over DeleteFile() and it says that it's referencing sysutils\filutil.h, which comes after Windows now. Googling around I found someone who said if there are name collisions, the last unit in the Uses list wins, so that sounds right.