Bosse_B
Posts: 1062
Joined: Thu Jan 30, 2014 9:53 am

Compiling a freepascal program for Pi2

Thu Sep 17, 2015 11:25 pm

I have a need to port a Delphi console program written for Windows to be used on RaspberryPi2.
Apparently it is possible to use Freepascal to get programs running on the Pi2 platform, but can it be done in Windows so I don't have to install the complete IDE on a Pi and set it up with a monitor, keyboard and mouse just for running the compile?

The program is a communication module that talks over TCP/IP sockets to a data collection device connected via WiFi.
I use the Indy10 TCP/IP components (created in code) to communicate and the data is decoded and stored on disk.

Any experience with a similar project would be good to read about!
Bo Berglund
Sweden

ghans
Posts: 7883
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Compiling a freepascal program for Pi2

Fri Sep 18, 2015 7:49 am

You could install Lazarus on the Pi and use Remote Desktop (VNC) or SSH so that a screen is never necessary , only a network connection.

Alternatively , try this:

http://wiki.freepascal.org/fpcup#Linux_ ... s_compiler

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Heater
Posts: 16540
Joined: Tue Jul 17, 2012 3:02 pm

Re: Compiling a freepascal program for Pi2

Fri Sep 18, 2015 11:10 am

The first thing to do here is get your program built and running using Free Pascal on your PC. Under Windows, Mac, Linux, whatever you have.

I say this because even if FPC can build Delphi programs I suspect there may be issues to resolve and you will find it much more comfortable to do that on a PC.

When the code is working on the PC move the source to the Pi and compile it with fpc. No need for the Lazarus IDE there.

You don't need any screen, keyboard or mouse, just move the files using scp and then login using ssh and do the compilation on the command line.

We have Pascal apps that we build all the time for Raspi and other ARM boards this way.
Memory in C++ is a leaky abstraction .

ghamm
Posts: 13
Joined: Mon Apr 20, 2015 6:05 pm

Re: Compiling a freepascal program for Pi2

Sat Sep 26, 2015 5:37 am

I am doing lots of TCPIP with my PI.. I converted many of my Delphi libs over to FP.. Works like a champ. If you need help, check us out on facebook.. "free pascal raspberry pi"

Return to “Other programming languages”