app.lpr(43,1) Error: Undefined symbol: XMM_::=::\_XGETMEM$LONGWORD::=::\POINTER
app.lpr(43,1) Error: Undefined symbol: XMM_::=::\_XFREEMEM$POINTER::=::\LONGWORD
app.lpr(43,1) Error: Undefined symbol: XMM_::=::\_XREALLOCMEM$POINTER$LONGWORD::=::\POINTER
app.lpr(43,1) Error: Undefined symbol: XMM_::=::\_XMEMSIZE$POINTER::=::\LONGWORD
app.lpr(43,1) Verbose: There were 4 errors compiling module, stopping
Verbose: Compilation aborted
This doesn't just happen occasionally; its on EVERY subsequent compilation. Clean builds are ok, but otherwise its 100% reproducible.
Here's the setup:
XMM is a unit, and its in the "uses" in the implementation section of "system.pas". In "system.pas" there are functions like "GetMem" that use XMM functions; for example "GetMem" calls "xgetmem".
I have no idea how to fix this. One option might be to not use "uses" and put everything in "system.pas" (perhaps as included files), but having it in "uses" is more convenient if update of XMM unit is required.
If that makes any difference, XMM is a memory manager I made; its used elsewhere, but in this case, its for a custom RTL. The original system.pas/pp doesn't use "uses" at all, maybe it cant, or shouldn't? But it does compile and run fine, just not reusable. Only clean builds work.
EDIT: FPC 3.2.2