So I tried compiling my first addin.

I am having 2 problems:

1. There is no image displayed for the addin icon.
2. Running the addin simply causes the calculator to reboot with no warning whatsoever.

directory setup:

Code:

flyingfisch@Office-Optiplex-745:~/PrizmSDK-0.3/projects/test$ ls -R
.:
Makefile  selected.bmp  src  test.bin  test.g3a  unselected.bmp

./src:
test.c  test.o


test.c:

Code:

#include <fxcg/display.h>
#include <fxcg/keyboard.h>

int main() {
   int key;

   while (1) {
      Bdisp_AllClr_VRAM();
      GetKey(&key);
      switch (key) {
         case KEY_CTRL_EXE:
         PrintXY(1,1,"  Hello World!",TEXT_MODE_NORMAL,TEXT_COLOR_BLACK);
      }
   }

   return 1;
}


Makefile:

Code:


CC=sh3eb-elf-gcc
MKG3A=mkg3a
RM=rm
CFLAGS=-m4a-nofpu -mb -Os -mhitachi -Wall -I../../include -lgcc -L../../lib
LDFLAGS=$(CFLAGS) -nostartfiles -T../../toolchain/prizm.x -Wl,-static -Wl,-gc-sections
CSOURCES=src/test.c
OBJECTS=src/test.o
BIN=test.bin
ADDIN=$(BIN:.bin=.g3a)
 
all: $(ADDIN)
 
$(BIN): $(OBJECTS)
   $(CC) $< $(LDFLAGS) -o $@
 
$(ADDIN): $(BIN)
   $(MKG3A) -n :test $< $@
 
.s.o:
   $(CC) -c $(CFLAGS) $< -o $@
 
.c.o:
   $(CC) -c $(CFLAGS) $< -o $@
 
clean:
   $(RM) $(addprefix $(OUTDIR)\,$(OBJECTS)) $(BIN) $(ADDIN)




Any ideas?

EDIT:
Pretty sure this has to do with libfxcg, because compiling on the vanilla SDK works fine.
OK, now, using the standard SDK, which worked absolutely fine yesterday, get this error:


Code:

flyingfisch@Office-Optiplex-745:~/Desktop/PrizmSDK-0.3/projects/example$ make
sh3eb-elf-gcc  example.o -mb -m4a-nofpu -mhitachi -nostdlib -T/home/flyingfisch/Desktop/PrizmSDK-0.3/common/prizm.ld -Wl,-static -Wl,-gc-sections  -L/home/flyingfisch/Desktop/PrizmSDK-0.3/lib -lfxcg -lgcc -o /home/flyingfisch/Desktop/PrizmSDK-0.3/projects/example/example.bin
make[1]: sh3eb-elf-gcc: Command not found
make[1]: *** [/home/flyingfisch/Desktop/PrizmSDK-0.3/projects/example/example.bin] Error 127
make: *** [build] Error 2


Default example file, i made no changes.
Every time you open a new shell, you need to tell it where's the sh4 GCC before using make:


Code:
export PATH=$PATH:/usr/local/cross/bin

And replace /usr/local/cross/bin with the path to where you put GCC, in case it is different from mine.
gbl08ma wrote:
Every time you open a new shell, you need to tell it where's the sh4 GCC before using make:


Code:
export PATH=$PATH:/usr/local/cross/bin

And replace /usr/local/cross/bin with the path to where you put GCC, in case it is different from mine.


Yup, just figured that out. added that to common/prizm_rules
  
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