Recent

Author Topic: Trying to crosscompile to win32 from Linux64  (Read 5464 times)

99Percent

  • Full Member
  • ***
  • Posts: 154
Trying to crosscompile to win32 from Linux64
« on: July 11, 2011, 05:32:47 am »
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_Linux

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

  • Hero Member
  • *****
  • Posts: 8244
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Trying to crosscompile to win32 from Linux64
« Reply #1 on: July 11, 2011, 04:37:13 pm »
Quote
What 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

  • Full Member
  • ***
  • Posts: 154
Re: Trying to crosscompile to win32 from Linux64
« Reply #2 on: July 11, 2011, 06:52:27 pm »
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

  • Hero Member
  • *****
  • Posts: 8244
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Trying to crosscompile to win32 from Linux64
« Reply #3 on: July 12, 2011, 06:47:52 pm »
Quote
I found ppcross386 in my fpc sources folder and copied it to my /usr/bin folder
You better put in under /usr/lib/fpc/<version>, as that is where other ppXXX should reside. In /usr/bin, create only its symlink.
Quote
Still 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:
Quote
Error: ppcross386 can't be executed, error message: Failed to execute ""ppcross386"  dummy.pas ", error code: 2

 

TinyPortal © 2005-2018