Building the application

To build set the working directory to the src and open a task window (by pressing Ctrl+F12). You need to make sure there is enough memory for the compiler so issue the command WimpSlot -min 8192K.

The application can be built from the command line with;

gcc -o^.!RunImage -ITBX: -LTBX: -ltbx main.cc

To save typing download and use Make (available from www.riscos.info). And create the following makefile

# Makefile for TBX Min

CXXFLAGS = -O2 -Wall -mpoke-function-name -mthrowback -ITBX:

LD = g++
LDFLAGS = -LTBX: -ltbx -lstdc++ -static

CCSRC = $(wildcard *.cc)
OBJECTS = $(CCSRC:.cc=.o)

^.!RunImage:	!RunImage,e1f
	elf2aif !RunImage,e1f ^.!RunImage
!RunImage,e1f:	$(OBJECTS)
	$(LD) $(LDFLAGS) -o !RunImage,e1f $(OBJECTS)

This makefile will compile all the C++ files in the current directory and link them to the tbx library. Additionally it passes the compiled application through the elf2aif process which means that the ELF program runner does not need to exist on the machine it runs on.