[fpc-pascal] msdos: unresolved external

Thomas Kurz fpc.2021 at t-net.ruhr
Wed Jul 12 12:27:23 CEST 2023


I have to extend code from QuickBasic and am using the "msdos" target from FPC 3.2 for that purpose. The resulting exe file is linked with Microsoft Linker for DOS version 5.10. It links *.a files created both from QuickBasic and FPC. The memory model is i8086-small.

Basically, it works well.

I have to use file functions now (Assign, Reset, Close) and as soon as I start using any of these, linking fails with the following unresolved dependencies:

Z:\SYSTEM.LIB(prt0s.asm) : error L2029: '__stklen' : unresolved external
Z:\SYSTEM.LIB(prt0s.asm) : error L2029: 'PASCALMAIN' : unresolved external
Z:\SYSTEM.LIB(prt0s.asm) : error L2029: '___heap' : unresolved external
Z:\SYSTEM.LIB(system0s896.o) : error L2029: 'INITFINAL' : unresolved external
Z:\SYSTEM.LIB(prt0s.asm) : error L2029: '___stacktop' : unresolved external
Z:\SYSTEM.LIB(prt0s.asm) : error L2029: '__fpc_stackplusmaxheap_in_para' : unresolved external

To me, it looks as if these were very basic code for memory management. I found (e.g.) "__fpc_stackplusmaxheap_in_para" in prt0comn.asm in which is declared "extern". But I'm unable to see which external object is responsible for it.

Note that I'm *not* compiling and linking the full program with FPC, I'm only developing parts of it. The main part comes from QuickBasic. But as FPC is able to build fully working MS-DOS executables in which (I assume) it needs the criticized external dependencies as well, they should exist somewhere, shouldn't they? But what do I need to link against for them to be included?

Thanks for helping,
Thomas



More information about the fpc-pascal mailing list