Forum > Other
[SOLVED] Racking my brain for a hello world compile for MSDOS
chobani:
Is there any step by step example to compile MSDOS target from WIN32/64? I installed the cross compiler for FPC, it's in the correct directory that lazarus is targeting for FPC. When I try and select that as a target I get "The current FPC has not config file." Okay, I see that all over when I search google, but I never seem to get a direct answer for windows on what and where I'm supposed to do.
I'd really appreciate it if someone could do a RTFM point to some exact steps. I just want to get to the point where I can do a simple writeln('Hello world!'); to MSDOS. I can see it's working for other people and I can only get to the point of installing the cross compiler to my FPC directory. Much appreciated!
PascalDragon:
So, just to be clear, in the same directory as the fpc.exe that Lazarus' configuration points to, there is your native compiler (ppc386.exe or ppcx64.exe) as well as the i8086 cross compiler (ppcross8086.exe)? In the settings of your project you selected i8086 as processor and MSDOS as operating system?
chobani:
Ahhhh okay, thank you. So no it's not in the same directory because I am using 64 so my bin directory looks like i386-win32 (cross compiler is there) and x86_64-win64 where my main compiler is. So I guess my options are installing win32 FPC or finding x86_64 version? I checked and didn't see any other windows options, but I might be looking in the wrong area. Thanks so much for the reply!
chobani:
So I copied the files in the same dir and tried to run from command line. I've seen others run into this too, but can't seem to find specific steps to resolve.
Free Pascal Compiler version 3.2.2 [2021/05/19] for i8086
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: MS-DOS 16-bit real mode
Compiling helloworld.lpr
Fatal: Can't find unit system used by helloworld
Fatal: Compilation aborted
Error: C:\lazarus\fpc\3.2.2\bin\x86_64-win64\ppcross8086.exe returned an error exitcode
So I guess if I could just have some guidance on maybe the fpc.cfg I'm guessing base on other posts? Thanks again!
PascalDragon:
--- Quote from: chobani on November 09, 2022, 09:11:50 pm ---So I guess if I could just have some guidance on maybe the fpc.cfg I'm guessing base on other posts? Thanks again!
--- End quote ---
Please check the paths inside your fpc.cfg which should be located in the x86_64-win64 directory. There should be various entries like the following (adjusted to your own location obviously):
--- Code: ---# Search for $fpctarget/$fpcsubarch-$fpcmemorymodel/ subdirectory first
# for i8086 CPU
#ifdef cpui8086
-FuC:\lazarus\2.2\fpc\$FPCVERSION/units/$fpctarget/$fpcsubarch-$fpcmemorymodel
-FuC:\lazarus\2.2\fpc\$FPCVERSION/units/$fpctarget/$fpcsubarch-$fpcmemorymodel/*
-FuC:\lazarus\2.2\fpc\$FPCVERSION/units/$fpctarget/$fpcsubarch-$fpcmemorymodel/rtl
#endif
--- End code ---
Please note that in case of MSDOS the value for $fpctarget will be msdos and not i8086-msdos.
--- Quote from: chobani on November 09, 2022, 09:11:50 pm ---So I copied the files in the same dir and tried to run from command line. I've seen others run into this too, but can't seem to find specific steps to resolve.
--- End quote ---
You can also pass -vut to the compiler to see where it tries to search for its units (and the configuration file) to see whether everything matches with what is expected.
Navigation
[0] Message Index
[#] Next page