You've having trouble because you're not building with our defined process at all. The undefined reference error is thrown by the linker (Bdisp_AllCr_VRAM is indeed provided by display.h in libfxcg) because it can't find the library file providing that function, implying your library include paths are wrong. Coupled with the fact that you're building to a file a.out, you either didn't use our Makefile as a template at all or removed things willy-nilly without understanding what you were doing.
You should also
not be using stdio (never mind you don't even use it in that one-liner), and doing so with the options outlined below will cause errors when compiling.
As we covered in IRC a little bit yesterday afternoon, the GCC toolchain is currently a bit 'squiffy', in that it should work in most situations, but you should be sure you understand what you're doing before trying to change things [much].
Do the following to compile without using our Makefile (requires the lib and include directories from the GCC SDK, also crt0.s and prizm.lkr), with your file test.c. This is all one line; your browser might wrap it since it's long:
Code: $ sh3eb-elf-gcc -m4a-nofpu -mb -mhitachi -Wall -nostdlib -Iinclude -lfxcg -lgcc -Llib -Tprizm.lkr -Wl,-static -o test.bin test.c crt0.s
(disclaimer: I didn't test that exact command)
Since I'm feeling generous, what all the options do:
-m4a-nofpu -mhitachi -mb
Compile for SH4A without using the FPU, complying to the Renesas (formerly Hitachi) ABI and for a big-endian system.
-Wall
Give lots of warnings when compiling.
-nostdlib -lgcc
Don't use the standard library provided by GCC (notably crt0), but do still link against libgcc (needed to do some operations which are not easily done on the processor, such as floating-point math).
-Iinclude -Llib -lfxcg
Look for include files in the include directory and library files in the lib directory, both needed to pick up libfxcg. Link against libfxcg as well.
-Wl,-static -Tprizm.lkr
Tell the linker to build a static binary and link with the script in prizm.lkr.
-o test.bin
Write output to test.bin.
test.c crt0.s
Build test.c and crt0.s. (If crt0 were to be omitted, you'd get linker errors about the .pretext section being missing)
You can then feed that into mkg3a:
Code: $ mkg3a test.bin
Based on the Makefile in what I think is the latest PrizmSDK package, you can change a few lines and get the same effect:
Code: SOURCES=test.c
...
BIN=test.bin
I also suggest changing the mkg3a line (line 16) to resemble my example earlier in this post, since the additional -n options merely serve to clutter up your command line (pre-0.1c mkg3a needed those, but not anymore).