Problem with SGDK via command line

SGDK only sub forum

Moderator: Stef

Post Reply
zedman3d
Newbie
Posts: 6
Joined: Sat Jul 14, 2012 9:17 am

Problem with SGDK via command line

Post by zedman3d » Sat Jul 14, 2012 9:28 am

Hello. Im new to mega drive dev.

Im sure its something simple but im getting errors when following these steps in the SGDK command line tutorial
http://code.google.com/p/sgdk/wiki/HowToUseSGDK

Heres a screenshot of the command window to make things easier, 'compile the library command' and 'compile project command' are outlined in red for readability.

http://i50.tinypic.com/23mv6dw.png

Im thinking its to do with the warning in the wiki:
"Be careful, if you have another GCC installation you can have some conflicts when cc1 command will be called... " I did have codeblocks and codelite installed before trying (wanted to use command line though), i uninstalled to see if that made a difference but it didnt. Environment variables are set up correctly.

Any advice would help. Thank you.

EDIT: Problem is the same on my laptop. Both PC's run Windows 7 64bit...

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Sat Jul 14, 2012 9:39 am

You should add the sgdk bin directory to your PATH variable.

zedman3d
Newbie
Posts: 6
Joined: Sat Jul 14, 2012 9:17 am

Post by zedman3d » Sat Jul 14, 2012 9:52 am

I went to control panel -> advanced system settings -> environment variables

then appeneded ;%GDK_WIN%\bin to the end of the systems 'Path' variable and my own users 'PATH' variable too. Same result.

EDIT: Ive even changed the PATH variable temporarily in CMD using
PATH=%PATH%;%GDK_WIN%\bin

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Sat Jul 14, 2012 10:30 am

When you type gcc in cmd do you see gcc's output?

zedman3d
Newbie
Posts: 6
Joined: Sat Jul 14, 2012 9:17 am

Post by zedman3d » Sat Jul 14, 2012 10:33 am

Typing in just gcc gives:

gcc: no input files

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Sat Jul 14, 2012 11:57 am

Strange.
You should retry carefully all the steps in the tutorial.
It has been used by a lot of people and should work.
It is very likely you made a mistake.

zedman3d
Newbie
Posts: 6
Joined: Sat Jul 14, 2012 9:17 am

Post by zedman3d » Sat Jul 14, 2012 12:05 pm

Oh yeh for sure. I know the tut is all good.
Ill keep at it.

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Sat Jul 14, 2012 12:47 pm

Or you have some strange system settings or name/executables clashes.

zedman3d
Newbie
Posts: 6
Joined: Sat Jul 14, 2012 9:17 am

Post by zedman3d » Sat Jul 14, 2012 1:45 pm

^ Thats what im thinking.

greatkreator
Very interested
Posts: 158
Joined: Sat May 12, 2012 7:37 pm
Location: Ukraine

Post by greatkreator » Sat Jul 14, 2012 3:02 pm

I had the same problem when I had few GCCs installed on the same system.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Jul 14, 2012 4:47 pm

Instead of putting it at the END of the PATH env variable, try it at the START. If there's another version of gcc interfering, having it at the start would give it priority where having it at the end would make it useless.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sat Jul 14, 2012 7:34 pm

The 'cc1' error as the makefile problems are typical of severals GCC installations conflicting. I'm pretty sure the make as the gcc compiler called aren't the good one.
If you type "gcc --version" what is displayed ?

zedman3d
Newbie
Posts: 6
Joined: Sat Jul 14, 2012 9:17 am

Post by zedman3d » Sun Jul 15, 2012 1:12 am

Thanks guys its all working now.

So the problem was in fact the placement of the directory in the path variable at the end. So placing at the front solved the conflict. A note in the tutorial about this may help others. Also if putting it at the front causes problems with other programs now, it might be a good idea to suggest in the tutorial alternatively temporarily setting the path variable for the opened cmd window.

Thanks.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Jul 15, 2012 5:00 am

I have enough cross-compilers on my system that I now never put the compiler bin path in the path envvar. Instead, I write the makefiles to use the proper path to the appropriate cross-compiler. It's less hassle that way. A makefile would typically start like this (for the 32X)

Code: Select all

ifdef $(GENDEV)
ROOTDIR = $(GENDEV)
else
ROOTDIR = /opt/toolchains/sega
endif

LDSCRIPTSDIR = $(ROOTDIR)/ldscripts

LIBPATH = -L$(ROOTDIR)/sh-elf/lib -L$(ROOTDIR)/sh-elf/lib/gcc/sh-elf/4.6.2 -L$(ROOTDIR)/sh-elf/sh-elf/lib
INCPATH = -I. -I$(ROOTDIR)/sh-elf/include -I$(ROOTDIR)/sh-elf/sh-elf/include
That allows me to have an envvar with a path, or to use a set path. In either case, I don't use the system PATH envvar.

Post Reply