I'm working with the DC Development Kit-on-an-ISO made by LyingWake (I think I have that right?), with cygwin under Windows XP Pro.
Unfortunately, because I haven't worked with makefiles before (I'm really a VC++ 6.0 kind of guy), I'm having all sorts of problems. The most I've ever done with a makefile before was to alter the source and target objects, so I'm in over my head here, I think.
I was getting all sorts of errors at first, mostly stemming from the fact that GCC couldn't find SDL.h, SDL_mixer.h (left in my program for future reference - if it won't work now, it won't work then), and SDL_ttf.h. I tried working from two example SDL-using makefiles (one from here and one from DCEmu.co.uk), and neither one would tell GCC where to look. The only way I could finally move past that error was to go into kos-ports/include/SDL and copy everything into my project directory (C:\cygwin\usr\local\dc\kos1.3\kos\techdemo). Then GCC started whining about my timing routine (int clock = SDL_GetTicks(); ) and mismatched types, so I commented all that stuff out. Then GCC started complaining about itoa() being undefined (I use it to append the sprite's position to a basic string -- I'm working with #include <string>, if there's anything better I can use, please tell me ), so I commented that line out. Now I'm getting about four dozen dozen linker errors that seem to be saying that I don't have a standard library. There also seem to be a few errors referring to the SDL_TTF library.
From what I've been reading on here and elsewhere, I was under the impression that at least part of the STL worked under KOS/SDL? I've worked with pointers, can write my own linked lists, etc., but I have neither the time nor the desire to reinvent the string class.
My makefile is here:
Code: Select all
TARGET = target.elf
OBJS = main.o sprite.o
all: rm-elf $(TARGET)
include $(KOS_BASE)/Makefile.rules
KOS_CFLAGS += -DENABLE_FOCUS
clean:
-rm -f $(TARGET) $(OBJS) romdisk.*
rm-elf:
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS)
$(KOS_CCPLUS) $(KOS_CFLAGS) $(KOS_CPPFLAGS) $(KOS_LDFLAGS) -I$(KOS_BASE)/../kos-ports/include/SDL -o $(TARGET) $(KOS_START) \
$(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgcc -lSDL -lpng -lz -ljpeg -lSDL_mixer -lSDL_image -lSDL_TTF -lSDL -lpng -lz -ljpeg -lm -lk++ $(KOS_LIBS)
run: $(TARGET)
$(KOS_LOADER) $(TARGET)
Since I have only a very vague idea what a ROMDISK is, I'm not using one, but I don't think that should be causing the kind of errors I'm getting.
I've already tried both source environ.sh, and source environ_dreamcast.sh, and neither one seems to make any difference.
My #includes are as follows:
Code: Select all
#include "SDL.h"
#include "SDL_ttf.h"
#include "SDL_mixer.h"
#include <stack>
#include <string>
#include "sprite.h"
I do appreciate any help you can offer!
EDIT:
I should add I'm also getting the ubiquitous "___gxx_personality_v0" error - which doesn't make any sense, since I'm using CPPFLAGS in addition to CFLAGS, and I have absolutely no exceptions in my code.