I've followed the instructions from the UsingGCC page on the fxSDK Wiki, and have successfully compiled a toolchain (using MinGW). However, I am having trouble getting a simple example program to compile.
My code is (based on the official SDK example):
#include "fxlib.h" int main() { unsigned int key; Bdisp_AllClr_DDVRAM(); locate(1,1); Print((unsigned char*) "Hello!"); while(1){ GetKey(&key); } return 1; }
The command I am using to compile is:
toolchain\bin\sh3eb-elf-gcc -m3 -mb -O9 -nostdlib -T"addin.ld" crt0.s main.c -o app.elf -Itoolchain/include
When I try to run the above command, I get:
*snip*/toolchain/bin/../lib/gcc/sh3eb-elf/4.6.4/../../../../sh3eb-elf/bin/ld.exe: warning: section `.bss' type changed to PROGBITS *temp folder*\ccmcj6Qw.o: In function `main': main.c:(.text.startup+0x24): undefined reference to `Bdisp_AllClr_DDVRAM' main.c:(.text.startup+0x28): undefined reference to `locate' main.c:(.text.startup+0x2c): undefined reference to `Print' main.c:(.text.startup+0x30): undefined reference to `GetKey' collect2: ld returned 1 exit status
Inside my toolchain/include directory are my fxlib.h files, etc (copied from the official SDK's OS\FX\include directory).
I believe the problem is that I do not have the libraries for fxlib.h. I have attempted to use fx9860G_library.lib, but this appears to be some sort of crazy non-standard file which I can't use.
EDIT: After a bit more Googling and trial-and-error, it would appear that the object files inside fx9860G_library.lib aren't even the right format... Is there any way I can use my locate()s and Print()s without using the official SDK?
Edited by RunasSudo, 09 May 2013 - 09:24 AM.