This design works great in Delphi, but it doesn’t link in FreePascal:
Project1.dpr(14,1) Error: Undefined symbol: P$PROJECT1_$$_ADD$LONGINT$LONGINT$LONGINT$$LONGINT
Tell me, please, how to fix this?
Add cdecl; before (important!) external; ?
It links well without (and with) it on x86_64-linux, but windows might have different treatment. C compilers exported symbols for Windows (AFAIK only in 32-bit, so I find it strange it happens on you) adds _ prefix to the function name, as can be seen in the "undefined symbol" message.