<p>Am 07.10.2017 10:57 schrieb <<a href="mailto:pascalX@piments.com">pascalX@piments.com</a>>:<br>
><br>
> Hi,<br>
><br>
> I am having trouble getting fpc to cross-compiler for win64 target.<br>
><br>
> I'm using fedora 26 which supplies 3.0.2<br>
><br>
> I used instructions here to create the cross compiler using trunk fpc since the fedora fpc-src does not seem to have the full Makefile structure:<br>
><br>
> <a href="http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Linux#Free_Pascal">http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Linux#Free_Pascal</a><br>
><br>
> I have a simple test file:<br>
><br>
> {$MACRO ON}<br>
> program Hello;<br>
> begin<br>
> Writeln('Hello world, from FPC ', FPC_FULLVERSION, '!');<br>
> end.<br>
><br>
><br>
> This builds fine using the stock fpc 3.0.2 with linux target. However, the supposed cross-compiler seems to be trying to build for linux.<br>
><br>
> $/usr/lib/fpc/3.1.1/ppcrossx64 /back/coredata/hello.pas<br>
> Free Pascal Compiler version 3.1.1 [2017/10/06] for x86_64<br>
> Copyright (c) 1993-2017 by Florian Klaempfl and others<br>
> Target OS: Linux for x86-64<br>
> Compiling /back/coredata/hello.pas<br>
> Fatal: Can't find unit system used by Hello<br>
> Fatal: Compilation aborted<br>
><br>
><br>
> $/usr/lib/fpc/3.1.1/ppcrossx64 -iTO<br>
> linux<br>
><br>
><br>
><br>
> So where is my cross compiler ??<br>
><br>
> Thanks for any help and suggestions.</p>
<p>A single compiler binary can always compile for all supported targets of that processor. So as long as all the units are available you simply need to pass "-Twin64" as additional parameter to compile for x86_64-win64.</p>
<p>Regards,<br>
Sven</p>