Author Topic: Cross-compiling Lazarus application from Windows7 to Raspbian  (Read 6354 times)


  • New Member
  • *
  • Posts: 19
Generally Windows-literate and a long-time user of Delphi, but totally ignorant of Linux, I have spent hours inextricably lost in the maze of HowTo Cross-compile from a Lazarus windows7 app to produce an executable that will run on my Raspberry pi's debian ARM6 system. 
I now have CodeTyphon installed on the Windows7 PC and Lazarus apps I have written using Lazarus in CodeTyphon compile and work on that PC.  I have used Lazarus on the Raspi and can more or less already cope with that.
What I cannot get my head around is how to take that lot on Windows7 and end up with an executable to run on my Raspi. 
The folks at CodeTyphon don't respond to my queries on their forum, and their examples do not cover Windows7 to Raspbian or tell me enough for me to work it out for myself.
Could anyone here point me to a HowTo that will reveal all, please?

Sternas Stefanos

  • Full Member
  • ***
  • Posts: 170
  • Ex Pilot, M.Sc, Ph.D
« Last Edit: April 12, 2013, 06:57:02 pm by Sternas Stefanos »
CodeTyphon Architect and Programmer


  • New Member
  • *
  • Posts: 19
Re: Cross-compiling Lazarus application from Windows7 to Raspbian
« Reply #2 on: April 23, 2013, 04:52:12 pm »
Pardon my ignorance but that does not seem to respond in a way I can use it to do what I need, which is to write and compile a Lazarus application under windows7 and then cross-compile it to produce an executable for my Raspberry pi.  I have tried for many hours to use CodeTyphon to do this but there seems to be no documentation or usable examples available in their 'help' or support regime and I have had to leave that.


  • Hero Member
  • *****
  • Posts: 675
    • J-Software
Re: Cross-compiling Lazarus application from Windows7 to Raspbian
« Reply #3 on: April 23, 2013, 07:27:11 pm »
Easiest is to copy all pascal sources, lpi and lpr files to the Raspberry Pi and compile it with Lazarus directly on there. You can use "lazbuild project.lpi" from a shell if you don't have a graphical interface. Crosscompiling from Windows to Linux with a stock Lazarus is never easy and takes a lot of manual fiddling..

My workflow when I absolutely have to compile from a Windows machine: You will have to have the correctly built binutils for the target platform(with correct EABI version), then you should copy all needed shared libraries from the board to your Windows computer(and you'll then have to rename all symlinks to copies of real files). Basically you'll just have to fiddle around with shared libraries and GNU ld options until it compiles... :)

You can just alter the CPU and OS target and try to compile. If it compiles then you should see linker errors: "Could not find -lgtk-pixbuf-2.0" or something. That means you need to direct the linker to a correct "". A normal program will need about 20-30 such libraries that you need to meticulously find and copy to the windows machine. I don't know if there's a smarter method :)


  • New Member
  • *
  • Posts: 30
Re: Cross-compiling Lazarus application from Windows7 to Raspbian
« Reply #4 on: August 06, 2013, 11:37:13 pm »
I installed lazarus to my Rpi and now I am trying to install zeos to compile my project but I am getting a weird error:
TExternalTool.Run : Error

lazarus runs so fine on my PI but I cant compile my project

Any cluees?


TinyPortal © 2005-2018