[fpc-pascal] Cross-compilation to Linux from win32

Simon Kissel scamp at untergrund.net
Fri Jan 14 19:55:56 CET 2005


Hi,

after quite some time I thought to give FPC another try to see if it's
a suitable replacement for Kylix.

My goal is to be able to cross-compile Linux elf targets from win32.

So I downloaded and installed 1.9.6, and after that added the units
packages for Linux.

Run up FP, compiled hello world, worked. Switched the target in FP to
linux, compiled again - and wow, it also worked. Using the verbose
output I could even see it using the Linux units etc. All fine.

Until I examined the generated executable "hello". It looks like it's
a Linux binary packed into a PE file. Very weird. Doesn't run under
Linux of course, and does nothing under Windows.

Next attempt was to use fpc directly:

C:\pp\demo\text>fpc -Aelf hello.pp
Free Pascal Compiler version 1.9.6 [2004/12/31] for i386
Copyright (c) 1993-2004 by Florian Klaempfl
Target OS: Win32 for i386
Compiling hello.pp
Linking hello.exe
31 Lines compiled, 0.4 sec

Well, no.

Some advise on what to do would be very welcome.

Thanks,

Simon





More information about the fpc-pascal mailing list