> On Jan 2, 2020, at 2:57 PM, Ryan Joseph <generic...@gmail.com> wrote:
> 
> extern C_LINKAGE int SDL_main(int argc, char *argv[]);
> 
> which they call from within the iOS event loop and that calls the programs 
> main functions which was defined using -XMSDL_main

I still can't figure out how -XM works. Can anyone provide an example? When 
ever I try to use it I get linker errors.

I've basically just started with a trimmed down program that does nothing but 
define an external new main function (like SDL does). From the SDL sources I 
thought that it would now point to the main program body but I can't get past 
linker errors.

fpc main.pas -XMuser_main



Undefined symbols for architecture x86_64:
  "_P$TEST_$$_USER_MAIN$LONGINT$PCHAR$$LONGINT", referenced from:
      _PASCALMAIN in main.o
  "_main", referenced from:
      start in crt1.10.5.o
     (maybe you meant: _user_main)


program test;
uses
  ctypes;

function user_main(argc: cint; argv: pchar): cint; external;

begin
  user_main(0,'');
end.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to