raylib-go/examples/others/rpi/basic_window
2018-10-08 18:56:34 +02:00
..
main.go Update C sources, add new functions and rename package to 2018-10-08 18:56:34 +02:00
README.md Move android and rpi examples to others 2018-05-06 12:54:20 +02:00

Raspberry Pi example

To cross compile example for Raspberry Pi you will need RPi toolchain and userspace libraries (opt/vc).

Export path to RPi toolchain:

export RPI_HOME=/opt/tools/arm-bcm2708/arm-linux-gnueabihf

Add toolchain bin directory to PATH:

export PATH=${RPI_HOME}/bin:${PATH}

And compile example:

CC=arm-linux-gnueabihf-gcc \
CGO_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads --sysroot=${RPI_HOME}/arm-linux-gnueabihf/sysroot" \
CGO_LDFLAGS="-L/opt/vc/lib -L/opt/vc/lib64 --sysroot=${RPI_HOME}/arm-linux-gnueabihf/sysroot" \
CGO_ENABLED=1 GOOS=linux GOARCH=arm go build