Hello all. I am looking for some help with developing in C for the Casio Prizm. I recently picked one up at a clearance sale and I have been itching to take it for a test drive. Anyway, I have successfully compiled binutils and GCC for cross compilation, but when I go to try to compile the example file given in the PrizmSDK, I get the following error:


Code:

./example.c:1:30: fatal error: display_syscalls.h: No such file or directory
 #include "display_syscalls.h"


I don't know how to get it to point to the correct includes folder. Can anyone point me to some more detailed information about how to fix my setup problems? Any help is greatly appreciated! Very Happy [/quote]
libfxcg is what is currently supported. That header is deprecated and has been replaced with <fxcg/display.h>. I recommend you look at https://github.com/Jonimoose/libfxcg

For starters, Using the -I flag for GCC to add include paths (-I<relative path>).
Thanks AHelper, I am one step closer it seems. Now I'm recieving the following error, for which googling doesn't seem to be netting any results at the moment.


Code:

/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status


Here's the verbose output. It seems to have much more useful information, but I still haven't pinned down the fix yet.


Code:

Using built-in specs.
COLLECT_GCC=sh3eb-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/lto-wrapper
Target: sh3eb-elf
Configured with: ../configure --target=sh3eb-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers : (reconfigured) ../configure --target=sh3eb-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers : (reconfigured) ../configure --target=sh3eb-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers
Thread model: single
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-I' '/home/mordecai/prizm-gcc/PrizmSDK-0.3/libfxcg/include/'
 /usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/cc1 -quiet -v -I /home/mordecai/prizm-gcc/PrizmSDK-0.3/libfxcg/include/ ./example.c -quiet -dumpbase example.c -auxbase example -version -o /tmp/ccy2drEj.s
GNU C (GCC) version 4.9.2 (sh3eb-elf)
   compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p11, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/sys-include"
ignoring nonexistent directory "/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/mordecai/prizm-gcc/PrizmSDK-0.3/libfxcg/include/
 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/include
 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/include-fixed
End of search list.
GNU C (GCC) version 4.9.2 (sh3eb-elf)
   compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p11, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 595814ca10a64a613fe7039d5f0f0f56
COLLECT_GCC_OPTIONS='-v' '-I' '/home/mordecai/prizm-gcc/PrizmSDK-0.3/libfxcg/include/'
 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/as -big -o /tmp/ccKVh2Yl.o /tmp/ccy2drEj.s
COMPILER_PATH=/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/libexec/gcc/sh3eb-elf/:/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/lib/gcc/sh3eb-elf/:/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/
LIBRARY_PATH=/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/lib/
COLLECT_GCC_OPTIONS='-v' '-I' '/home/mordecai/prizm-gcc/PrizmSDK-0.3/libfxcg/include/'
 /usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/collect2 -plugin /usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/liblto_plugin.so -plugin-opt=/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/lto-wrapper -plugin-opt=-fresolution=/tmp/ccOg4pko.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc-Os-4-200 -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc-Os-4-200 -m shelf /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crt1.o /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crti.o /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crtbegin.o -L/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2 -L/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/lib /tmp/ccKVh2Yl.o -lgcc -lgcc-Os-4-200 -lc -lgcc -lgcc-Os-4-200 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crtend.o /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crtn.o
/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status


Okay more tooling around and symlinking has reduced the number of errors down to this:


Code:

mordecai@HAL-9000:~/prizm-gcc/PrizmSDK-0.3/projects/example/src$ sh3eb-elf-gcc -v ./example.c
Using built-in specs.
COLLECT_GCC=sh3eb-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/lto-wrapper
Target: sh3eb-elf
Configured with: ../configure --target=sh3eb-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers : (reconfigured) ../configure --target=sh3eb-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers : (reconfigured) ../configure --target=sh3eb-elf --prefix=/usr/local/cross --disable-nls --enable-languages=c,c++ --without-headers
Thread model: single
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-v'
 /usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/cc1 -quiet -v ./example.c -quiet -dumpbase example.c -auxbase example -version -o /tmp/ccTpnnET.s
GNU C (GCC) version 4.9.2 (sh3eb-elf)
   compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p11, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/sys-include"
ignoring duplicate directory "/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/include
 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/include-fixed
End of search list.
GNU C (GCC) version 4.9.2 (sh3eb-elf)
   compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p11, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 595814ca10a64a613fe7039d5f0f0f56
COLLECT_GCC_OPTIONS='-v'
 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/as -big -o /tmp/ccuOroDU.o /tmp/ccTpnnET.s
COMPILER_PATH=/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/libexec/gcc/sh3eb-elf/:/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/lib/gcc/sh3eb-elf/:/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/
LIBRARY_PATH=/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/:/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/lib/
COLLECT_GCC_OPTIONS='-v'
 /usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/collect2 -plugin /usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/liblto_plugin.so -plugin-opt=/usr/local/cross/libexec/gcc/sh3eb-elf/4.9.2/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpV5bDV.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc-Os-4-200 -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc-Os-4-200 -m shelf /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crt1.o /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crti.o /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crtbegin.o -L/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2 -L/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/lib /tmp/ccuOroDU.o -lgcc -lgcc-Os-4-200 -lc -lgcc -lgcc-Os-4-200 /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crtend.o /usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/crtn.o
/usr/local/cross/lib/gcc/sh3eb-elf/4.9.2/../../../../sh3eb-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
You're essentially targeting a weird embedded system, so GCC needs a bunch of flags to generate the right kind of code. You're just invoking GCC with nothing extra, so it will definitely not do the right thing.

From the libfxcg examples:
Code:
CFLAGS= -mb -Os -mhitachi -Wall -Wextra -I../../include -lgcc -L../../lib
LDFLAGS=$(CFLAGS) -nostartfiles -T../../toolchain/prizm.x -Wl,-static -Wl,-gc-sections


Roughly:
  • -mb: compile in big-endian mode
  • -mhitachi: use the Renesas ABI because that's what the Prizm OS uses
  • -I../../include: add the libfxcg include directory to the system include path
  • -lgcc: explicitly link against libgcc
  • -L../../lib: explicitly search for libraries to link against in the libfxcg library directory
  • -Os -Wall -Wextra: optimize for size and turn on a bunch of warnings

  • -nostartfiles: Don't link against libc (we don't really have one) and don't use the default crt0 because we have our own.
  • -T../../toolchain/prizm.x: Use the linker script for Prizm rather than whatever GCC has.
  • -Wl,-static -Wl,-gc-sections: Statically link (we don't support dynamic linking at all) and remove unused sections from the binary

Remove any of those options at your peril, essentially.
Thanks Tari, I actually just stumbled across this same answer for myself when I was working on getting it going earlier, and I was just about to post my solution so others could see if they had my same issue.

It looks like everything is good to go now!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement