Hi All
I've converted the pigpio (see
abyz.co.uk/rpi/pigpio/index.html) .h header file to be able to use from within Lazarus on the Pi/Pi2 (hopefully it should work on all models) - I was having difficulty with some of the other libraries which either haven't been updated to to the Pi2 or are limited in functionality and this one seemed to have nearly everything in it so it made more sense to try and use this one rather than fix a limited library, this one appears to have virtually everything :) .
In order to build on the Pi I had to copy a particular hard float version of libgcc.a into the same folder as the pigpio library (I've included my libgcc.a from the Pi in the zip, I found two on my Pi2 and I guess it might have been linking the wrong one - some are missing some "long long" divide functions and give errors when building) - the pigpio library uses the "rt" and pthreads libraries so I'm already linking these in using {$linklib ...} in the unit header (see attached - I've separated out the pigpio types and consts into a separate unit).
It seems to work - tbh only used some basic gpio functionality against the PiLiter board so far (
shop.ciseco.co.uk/pi-liter-8-led-strip-for-the-raspberry-pi/) but it seems to work well (demo also in the attached) but only when compiled in Lazarus on the Pi2 itself. What I'd like to do is be able to cross compile via CodeTyphon. (I think) I've tried every combination of $linklib or $link with all the libraries it complains about but just can't get any application to link (and most of the libraries it complains about don't have to be specified when compiling on the Pi itself}.
On the Pi you probably need to install the pigpio library following this link;
abyz.co.uk/rpi/pigpio/download.html and then copy the two pigpio .pas files from the attached zip file into the root pigpio folder as the .h and .c files - I've put my PiLiter demo in a Lazarus folder with all the demo programs Joan has included.
Anyway, can anyone advise on what the linking should look like for cross-compiling - ideally I'd like the library to be able to compile locally (as it does already) and cross-build from other platforms so whether this might need some {$ifdef...} type inclusion to link in the necessary libraries when cross-compiling but unnecessary when building locally, so there's minimal needed to get it going.
TheBlackSheep