[fpc-pascal] Teaching Kids Using Free Pascal

Anthony Walter sysrpl at gmail.com
Sat Aug 27 12:47:26 CEST 2022


Chimpmunk2D is written in C and I compiled it on Windows using three
different compilers, each in an attempt to resolve the problem. I used
mingw64 gcc with Linux cross compile, Windows Cygwin, and Windows Msys2.
All fail for various reasons.

Regarding your missing __imp___acrt_iob_func, you can resolve individual
missing dependencies by providing them yourself using the 'alias' feature
of Free Pascal. This should at least resolve the dependency:

function acrt_iob_func: Pointer; cdecl; [ public, alias:
  Result := nil;

According to this stack overflow, the actual implementation should return a
pointer to an array of three HFILE items somewhat like FILE _iob[] =
{*stdin, *stdout, *stderr}; You can see if it can compile / link by using
my implementation above. In the situations where I was able to widdle down
the dependencis to to one or tow, this trick worked, but unfortunately
after that I would get an internal linker error. Even in cases where I
resolved all dependencies without the trick I still eventually end up with
an internal linker error.


Finally, I also wrote a utility to search for missing dependencies on


Henery Vermaak offered a similar solution for use at the command line.

(begin quote)

Note for anyone with msys2, you can make a file containing all defined
external symbols like this (using atexit as an example):

find /mingw64/lib -name "*.a" -exec nm -pogC --defined-only '{}' \; 2>
/dev/null > symbs.txt

Then search it with grep:

grep -w atexit symbs.txt

Resulting in:

T atexit
T atexit

(end quote)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20220827/d8eac41b/attachment.htm>

More information about the fpc-pascal mailing list