Trying to crosscompile to win32 from Linux64 lazarus / 1-Linux ---------------------------------------------------------------------- 99Percent · 2011-07-11 03:32 Hello, I am trying to set up my lazarus to both create linux64 and  crosscompile to win32 executables. I have managed to follow the instructions here: http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Lin ux and here: http://wiki.lazarus.freepascal.org/Cross_compiling albeit with some horrible pitfalls which I will later detail so that others don't fall into them. However now I am stuck with building the lazarus win32 components and library when I try to in /usr/lib/lazarus: sudo make clean all OS_TARGET=win32 CPU_TARGET=i386 I get the following error: Error: ppc386 can't be executed, error message: Failed to execute "ppc386", error code: 127 I have ppc386.exe in my /home/x/cross_fpc directory which was created when compiling fpc for win32 and I tried copying it to /usr/bin where fpc is (which really doesn't make sense since I think ppc386 is a windows executable). What I am missing? ---------------------------------------------------------------------- Leledumbo · 2011-07-11 14:37 QuoteWhat I am missing?You should have ppcross386 (linux ELF executable) instead of ppc386.exe (Win32 PE executable). I wonder how you get that ppc386.exe, if you invoke make clean all OS_TARGET=win32 CPU_TARGET=i386 in FPC source dir while you're on Linux64, you should get ppcross386 above. ---------------------------------------------------------------------- 99Percent · 2011-07-11 16:52 Thanks Leledumbo. I found ppcross386 in my fpc sources folder and copied it to my /usr/bin folder Lazarus now makes and installs fine to the target OS and CPU. I was able to crosscompile my first application without any problems and it runs fine in my target computer. What a joy! Still mistified as to why it would try to use ppc386.exe when ppcross386 is not present. I guess its a bug? ---------------------------------------------------------------------- Leledumbo · 2011-07-12 16:47 QuoteI found ppcross386 in my fpc sources folder and copied it to my /usr/bin folderYou better put in under /usr/lib/fpc/, as that is where other ppXXX should reside. In /usr/bin, create only its symlink. QuoteStill mistified as to why it would try to use ppc386.exe when ppcross386 is not present. I guess its a bug?I really have no idea about this, it should actually fail to find it. e.g. emitting message like: QuoteError: ppcross386 can't be executed, error message: Failed to execute ""ppcross386"  dummy.pas ", error code: 2