Raspberry / Linux: minimum sample console 'Hello World'
Posted: Tue Jan 04, 2022 4:59 pm
How-to compile a minimum console program on Raspberry or Linux
(Put package in your home dir (or wherever you want)
(uncompress it)
(use <tab> to complete the package name)
(whatever '' in name)
tar xvzf PureBasic...
(set PB home dir (only need for command line version))
export PUREBASIC_HOME=~/...
(make a sample pb code)
(use vi, nano or anything else)
(here, mini: 'cat' command)
(verify)
(compile)
./pbcompiler hello.pb -e hello
(yes, that's it)
(test)
./hello
Congratulation, you have done your first unix program 
(Put package in your home dir (or wherever you want)
(uncompress it)
(use <tab> to complete the package name)
(whatever '' in name)
tar xvzf PureBasic...
Code: Select all
pi@raspberry:~ $ tar xvzf PureBasic_Linux_beta_ <tab>
export PUREBASIC_HOME=~/...
Code: Select all
pi@raspberry:~ $ export PUREBASIC_HOME=~/purebasic
(use vi, nano or anything else)
(here, mini: 'cat' command)
Code: Select all
pi@raspberry:~/purebasic/compilers $ cat > hello.pb
PrintN("Hello World!")
^C
Code: Select all
pi@raspberry:~/purebasic/compilers $ cat hello.pb
PrintN("Hello World!")
./pbcompiler hello.pb -e hello
Code: Select all
pi@raspberry:~/purebasic/compilers $ ./pbcompiler hello.pb -e hello
PureBasic 6.00 Beta 1 - C Backend (Linux - arm32)
Loading external modules...
Starting compilation...
Starting compilation...
3 lines processed.
Creating the executable.
- Feel the ..PuRe.. Power -
(test)
./hello
Code: Select all
pi@raspberry:~/purebasic/compilers $ ./hello
Hello World!
