Page 1 of 1

Generate C source

Posted: Tue Jan 04, 2022 4:25 pm
by em_uk
Loving PB for armhf!

Is it possible to generate the C source created by pbcompiler?

I am writing programs on Bullseye and then running on stretch (its like an embedded system so no easy way to upgrade).

Basic console exe work great however if I am linking to libs such a pigpio they get tied to a later version of GLIBC and having the C output would mean I could compile on the target OS.

I've looked at the docs for pbcompile but when ran manually it complains

Code: Select all

pi@raspberrypi:~/Downloads/purebasic/compilers $ ./pbcompiler -c /tmp/PB_EditorOutput.pb 
PureBasic 6.00 Beta 1 - C Backend (Linux - arm32)
Loading external modules...
Error: Can't load OS libraries, please re-install PureBasic.

Re: Generate C source

Posted: Tue Jan 04, 2022 4:37 pm
by Marc56us
To compile in commmode line, you need to set PUREBASIC_HOME to you PB root dir

Code: Select all

$ export PUREBASIC_HOME=~/Downloads/purebasic
(not needed when use IDE)

Re: Generate C source

Posted: Tue Jan 04, 2022 5:39 pm
by em_uk
Awesome thanks - that works perfect.