This is part four of a five-part series of posts on compiling Amiga-specific C code on an (emulated) Amiga A1200. We’ll start with a machine with an empty hard drive, and over the series, build up to compiling an Amiga-specific program which uses the graphics library.
This one should be a pretty simple one. We’re going to compile a simple Hello World program to basically ensure that we installed our compiler and include files correctly.
So, here’s the simple C program we’re going to be compiling. It’s very straight-forward:
AmigaOS comes complete with a text editor called memacs. While primitive by today’s standards, it was a great program for its time. Let’s fire it up by opening a Shell, changing to the
RAM: directory, and editing a new file we’ll name
Type in our program, before choosing “Save-Exit” from the Project menu.
The C compiler that comes as part of VBCC is actually called vc, and we want to specify an output file of hello by using the -o parameter.
Assuming we didn’t get any errors, we can then run the program by executing
hello, like this:
That’s really all there is to it. If you got errors when compiling, it’s worth checking
S:user-startup to ensure that it contains the VBCC stuff below (the installer should have automatically added this).
So, to summarize, we’ve verified that the compiler is installed and working correctly, and can locate and use the standard include files. Next time, we’ll move on to our actual goal of compiling some Amiga-specific code!