Hi all, so I am getting started with the Casio CG50 C programming, I followed the instructions from this thread https://www.cemetech.net/forum/viewtopic.php?t=14119 which has worked great, gcc built fine and works, the libfxcg was built fine and its samples also work, and if i make a change and rebuild and deploy to calc that all works.
A problem happened when I used sprintf and included stdio.h, whichever sample I try to use this it results in the following error:
Code:
if you are wondering what I changed in the code, the full "skeleton" sample code would look like this:
Code:
I am on Windows 10 using WSL 2, stuff mentioned above has been tested on both Debian 11 and Ubuntu 20, same behavior.
please guide as to what am i doing wrong here? thanks.
A problem happened when I used sprintf and included stdio.h, whichever sample I try to use this it results in the following error:
Code:
sh3eb-elf-gcc example.o -mb -m4a-nofpu -mhitachi -nostdlib -T/home/ab/casio/libfxcg/toolchain/prizm.x -Wl,-static -Wl,-gc-sections -L/home/ab/casio/libfxcg/lib -lc -lfxcg -lgcc -o /home/ab/casio/libfxcg/examples/skeleton/skeleton.bin
/home/ab/casio-gcc/lib/gcc/sh3eb-elf/7.2.0/../../../../sh3eb-elf/bin/ld: BFD (GNU Binutils) 2.29.1 internal error, aborting at ../../binutils-2.29.1/bfd/linker.c:2162 in _bfd_generic_link_output_symbols
/home/ab/casio-gcc/lib/gcc/sh3eb-elf/7.2.0/../../../../sh3eb-elf/bin/ld: Please report this bug.
collect2: error: ld returned 1 exit status
make[1]: *** [/home/ab/casio/libfxcg/toolchain/prizm_rules:83: /home/ab/casio/libfxcg/examples/skeleton/skeleton.bin] Error 1
make: *** [Makefile:108: all] Error 2
if you are wondering what I changed in the code, the full "skeleton" sample code would look like this:
Code:
#include <fxcg/display.h>
#include <fxcg/keyboard.h>
#include <stdio.h>
void main(void) {
int key;
Bdisp_AllClr_VRAM();
Print_OS("Press EXE to exit", 0, 0);
char a[10];
sprintf(a, "hi %d", 5);
while (1) {
GetKey(&key);
if (key == KEY_CTRL_EXE) {
break;
}
}
return;
}
I am on Windows 10 using WSL 2, stuff mentioned above has been tested on both Debian 11 and Ubuntu 20, same behavior.
please guide as to what am i doing wrong here? thanks.