Need help with Takashi's Tutorial for Noobs....

Need help with Takashi's Tutorial for Noobs....


I keep getting this error when I try and compile the hello world code:

gcc main.c -O2 -m2 -g -c -I../../inc -o main.o

gcc -m2 -L../../lib -Xlinker -T../common/sl.lnk -Xlinker -Map -Xlinker -X

linker -e -Xlinker ___Start main.o -lsgl -o sl.coff

c:/dev/saturn/bin/ld.exe: cannot open crt0.o: No such file or directory

make.exe: *** [sl.coff] Error 1

I've used the directory he said to on his on the faq, and I used the compiler and sgl from antime's site (I think the links are down now). This is my setenv.bat file:

REM sh-hms




SET LIBRARY_PATH=c:\dev\SATURN\lib;c:\dev\SATURN\Sgl\lib

SET C_INCLUDE_PATH=C:\dev\SATURN\include;C:\dev\Saturn\Sgl\include;C:\dev\SATURN\Sgl\Inc

SET CPLUS_INCLUDE_PATH=C:\dev\SATURN\include\cxx;C:\SATURN\include;c:\dev\SATURN\Sgl\include;C:\dev\SATURN\Sgl\inc

REM Set TMPDIR to point to a ramdisk if you have one


Any help would be appreciated.
Need help with Takashi's Tutorial for Noobs....

One would assume you either

A) are Missing crt0.o


didn't declare your library path correctly

Make sure crt0.o is in your library path and double check to make sure you're setenv.bat was modified correctly.

Cyber Warrior X
Need help with Takashi's Tutorial for Noobs....

My advice for such a thing would be to 'give up' the hello world and start something new using a sample of the SGL as a basecode. It is easyer I think because everything is ready to compile and U just have to add a few line of code.

well ... just a thought ... hope it help ...
Need help with Takashi's Tutorial for Noobs....

Well, considering he's having enough problems just trying to compile the hello world sample, I doubt he'd have an easier time with the SGL samples.

Cyber Warrior X
Need help with Takashi's Tutorial for Noobs....


Can you post your setenv.bat file? It's ok if our directories are different; I'll just copy mine to yours. I rechecked mine and I can't find anything wrong. I redid the entire tutorial on my d drive and I had the same problem. Does casing matter? I'm going to try making everything lower case. thanks.
Need help with Takashi's Tutorial for Noobs....

did you manage to compile the Akira sample as stated in the tutorial ?
Need help with Takashi's Tutorial for Noobs....

I did no longer compiles correctly @$#@$@#$@#$.....oh well I'm going to retry this thing from the start. Thanks though.


Staff member
Need help with Takashi's Tutorial for Noobs....

I'm not sure that this matters, but you might not want to put it in C:\dev if you can help it. IIRC the Sega compiler uses old Cygwin stuff and might have issues with that directory (because /dev has a special meaning on Unixlike systems).
Need help with Takashi's Tutorial for Noobs....

hey all,

I've tried the tutorial 3 more times, on separate hds, on different partitions (ntfs and fat), and even on separate machines. I can't figure out what I'm doing wrong. Can somebody post their setenv.bat file here? or better yet can someone rar their development directory and send it to me? thanks I'd appreciate it.

Here's the exact error I get when I try to compile the Akira code:

"gcc -m2 -L../../lib -Xlinker -T../common/sl.lnk -Xlinker -Map -Xlinker -X

linker -e -Xlinker ___Start -nostartfiles ../common/cinit.o main.o aki_ashi.o a

ki_dou.o aki_kao.o aki_kata.o aki_ude.o aki_walk.o workarea.o -lsgl -o sl.coff

c:/satprog/saturn/bin/ld.exe: cannot open output file sl.coff: Permission denied

make.exe: *** [sl.coff] Error 1"
Need help with Takashi's Tutorial for Noobs....

Hn, the only chance is if you didn't run setenv.bat first, or if there's a sl.coff file in read-only mode. check for it.
Need help with Takashi's Tutorial for Noobs....

Everything works now. Turns out the copy of the compiler I was using had a few errors. I redownloaded everything from Anitime's site and all is well...I would like to thank everybody on this thread who offered suggestions. I'm sure it's annoying with a noob like me around
Anyway I have one last (this time I promise) question.

How do I set a pointer to a file on a cd? I have an interesting app which I'm working on, I don't wanna ruin the suprise, but how do I set a pointer to the file on the cd? I've tested the code with dummy data and it works, but I have no idea how to use the Saturn's fstream (I doubt it even has one). In C++ for win32 it's a cinch, but the saturn's a different story... Well that's my last question, this stuff is WAY too hard for me and I'm taking a break from programming
Need help with Takashi's Tutorial for Noobs....

You can't use the "file stream" functions, since that part of the Saturn is slightly complex (ie, you _can_ stream data from the CD, but it needs to know exactly what to do first). You can load files from the CD with a function like this (from the stardust code, based on sample8_8 or 8_9)...

#include <stdlib.h>

#include	"sgl_cd.h"

#include	"extern.h"

#include	"fileacc.h"

void LoadROM(){

	Sint32	dirwork[SLCD_WORK_SIZE(MAX_FILE)];

  	Sint32	ndir;

  	CDHN	cdhn;

  	CDKEY	key[2];

  	CDBUF	buf[2];

  	Sint32	stat;

  	Sint32	len[2];

	Uint16 PadData;

	Uint8 IsReady, cnt;

	Uint16 rom_slot = 0;

	Uint8 *rom_name;

	ndir = slCdInit(MAX_FILE, dirwork); 	//Initiates the CD...

	key[0].cn = key[0].sm = key[0].ci = CDKEY_NONE; //Sets the keys. Sets sector size...

	key[1].cn = CDKEY_TERM;  	//End of keys. This is pretty normal.

	cdhn = slCdOpen("PONG.SMC", key);  //The thing! This points to SMC...

	buf[0].type = CDBUF_COPY;  //CD Buffer, Copy to Work ROM (please?)

	buf[0].trans.copy.addr = ROMChunk; 	//Value to destination addr

	buf[0].trans.copy.unit = CDBUF_FORM1; 	//Standart sector size

	buf[0].trans.copy.size = READSECT; 	//I hope there's size enough.

	buf[1].type = CDBUF_TERM;  //Do it

	slCdLoadFile(cdhn, buf);  //Here we go...

	slPrint("Loading ROM...", slLocate(1,20));

	while (1) {


 stat = slCdGetStatus(cdhn, len);

 if (stat == CDSTAT_COMPLETED)	break;


	slPrint("Load ROM - Success!", slLocate(1,20));


This loads PONG.SMC from the CD to the pointer ROMChunk and you can play directly with in the fast memory (BTW, read the documentation to use LoWorkRAM, a free space that malloc() does not use). There is a prettier function in the Phoenix emulator, and you can also check the Stardust source code at , mainly fileacc.c and main.c.