Page 1 of 2

SGDK CodeBlocks Setup issues

Posted: Sun May 15, 2016 2:35 am
by MrTamk1s
Having purchased a new replacement laptop in February after the old one bit the dust, I'm looking forward to resuming work once again on homebrew development for the Sega Genesis, especially to finally stop procrastinating and to finish Ultra Air Hockey for a possible physical release.

However, I'm having trouble setting up SGDK for Code::Blocks again, despite following this guide, and keep getting the following error when I try to build:

Code: Select all

-------------- Build: default in Ultra Air Hockey (Retro) (compiler: SGDK)---------------
Target is up to date.
Nothing to be done (all items are up-to-date).
On the old laptop, I was using C::B 13.12 and SGDK 1.11, which worked well with it and could compile code. IIRC, in February 2016, on the new laptop, I installed the latest version of C::B (16.01) on the new laptop, but I kept getting the above compile issue, despite triple checking all of the steps in the installation guide. Since I develop on an SD Card, the absolute file paths are still the same at the G:\ drive for the migration to the new laptop (since I forcibly mounted the SD Card to map to the G:\ drive.)

After uninstalling it and downgrading to C::B 13.12 with mingw (to check if the new C::B release didn't break something), I still got the same issues. Just to double check if the downgrade didn't leave any leftover settings that could could still be affecting compilation on the new laptop, I decided to try installing C::B 16.01 with mingw in a new, clean install of Windows XP as a Virtual Machine today. Alas, still the same build issues. Will be trying a C::B 13.12 installation in a reinstall of a Windows XP VM tomorrow, but I have my doubts this will resolve anything.

Could somebody help me with troubleshooting the setup of SGDK for Code::Blocks? I must be overlooking something or broke something badly when I migrating to the new machine. I can neither get the project to compile for C::B 13.12 or for 16.01. I would also be glad to move to Visual Studio for SGDK if possible (heard someone at Spritesmind had setup VS for it once...)

SGDK Settings

Thanks in advanced! Getting SGDK setup on the new computer is the only thing preventing me from resuming SGDK development, and its frustrating.

Re: SGDK CodeBlocks Setup issues

Posted: Sun Jun 12, 2016 4:08 am
by L10N37
It took me 2 days of spending several HOURS trying to get codeblocks (or eclipse) working with SGDK
So far I've managed to muck around with changing back grounds and sprites using the samples and recompile (graphics gale for image editing)

But that's it

Anyway hope this helps, these are all the settings in the IMGUR album for ya.

http://imgur.com/a/iMXO2

SGDK WITH CODEBLOCKS 16.01 (Assuming you have already installed it)

Entire guide based off installation path of "C:\SGDK\" If you want it elsewhere, adjust to suit

Sega Genesis Development Kit (Program the Sega Megadrive/ Genesis in the C programming language)
Download SGDK: https://github.com/Stephane-D/SGDK/wiki/Download

1 - Environment Variables
2 - Copy compiler/ rename/ setup (tool chain ex path, app names, gcc.exe * 3, ld.exe, bintoc.exe, make.exe)
3 - Project properties, set up makefile
4 - build options ($make -f $makefile)
5 - Build sample and see if you get the ROM out

Oh also I think MinGW is just for regular C compiling outside of SGDK, I had to install it to do some practice projects in a little C course i started... shouldn't affect SGDK

Re: SGDK CodeBlocks Setup issues

Posted: Sun Jun 12, 2016 10:10 am
by Stef
Oh i completely missed the first message, i hope you sorted your problem MrTamk1s ! Maybe the message from L1ON37 can help you.
What was the problem in the Code::Block tutorial ? Did you know you have a complete tutorial here ? :
https://github.com/Stephane-D/SGDK/wiki ... CodeBlocks

Re: SGDK CodeBlocks Setup issues

Posted: Wed Jun 29, 2016 10:13 pm
by MrTamk1s
Haven't tried to install SGDK/Code::Blocks since the OP; but I will try to set it up it again this week and let everybody know how it works. From the pictures, looks like the setup is slightly different from the older version of Code::Blocks that I previously used.

Re: SGDK CodeBlocks Setup issues

Posted: Wed Jul 20, 2016 12:07 am
by MrTamk1s
Did everything Lion say to do, and got Code::Blocks 16.01 to compile again with my project :). Thanks!

Re: SGDK CodeBlocks Setup issues

Posted: Fri Feb 08, 2019 1:25 pm
by danibus
Hi there, sorry for posting in old post. Noob here, first time with sgdk and codeblocks.

Just installed CB 17.12 (last version) and sgdk. Make all steps to config all I think.

Tried "hello world" but Gens emulator says "ILLEGAL INSTRUCTION"

I re-check every step here (SETUP WITH CB), but don't know what is wrong.

Tried with different emulators.

So there is something wrong with CodeBlocks, but... where? Help pls!

Re: SGDK CodeBlocks Setup issues

Posted: Fri Feb 08, 2019 3:47 pm
by Stef
Can you post the log of the compilation process from the C::B output ?

Re: SGDK CodeBlocks Setup issues

Posted: Sat Feb 09, 2019 9:14 am
by danibus
attached, also attached Gens output ( https://prnt.sc/mipke5 )

Code: Select all

-------------- Build: default in test (compiler: Sega Genesis Compiler)---------------

Checking if target is up-to-date: make.exe -q -f E:\MD\sgdk\makefile.gen
Running command: make.exe -f E:\MD\sgdk\makefile.gen
/bin/mkdir -p src/boot
/bin/mkdir -p out
/bin/mkdir -p out/src
/bin/mkdir -p out/res
echo "out/main.o" > out/cmd_
/bin/gcc -B/bin -n -T /md.ld -nostdlib out/sega.o @out/cmd_ /lib/libmd.a /lib/libgcc.a -o out/rom.out
/bin/rm out/cmd_
/bin/objcopy -O binary out/rom.out out/rom.bin
/bin/sizebnd out/rom.bin -sizealign 131072
Process terminated with status 0 (0 minute(s), 8 second(s))
0 error(s), 0 warning(s) (0 minute(s), 8 second(s))

Re: SGDK CodeBlocks Setup issues

Posted: Sat Feb 09, 2019 10:04 am
by Stef
Your log look correct but you may have another GCC installation probably conflicting with the SGDK' one.. and the wrong GCC may be used instead.
Can you post the full rebuild log (as here it seems you built was already done so we can see only the linking part), then eventually having the generated ROM would help as well (given the Gens output it looks like you have 0 in place of code in some art at least).

Re: SGDK CodeBlocks Setup issues

Posted: Sat Feb 09, 2019 12:28 pm
by danibus
hmmmm I think no other GCC installation in my system. I test non-install version in another computer (directly with USB), after config all, same error.

This is what I have in CB:
Captura2.PNG
Captura2.PNG (69.86 KiB) Viewed 11618 times
As you see, debugger is Default ( I can't change).
Where to see full rebuild log to see linking part?

Also attached output ROM here
https://drive.google.com/open?id=1EPYeq ... bqIgdoqLIR

Re: SGDK CodeBlocks Setup issues

Posted: Sun Feb 10, 2019 12:43 pm
by danibus
Finally solved, more or less.

This is working:

Code: Select all

#include <genesis.h>
int main()
{
       VDP_drawText("Hello World!", 10, 13);

    while(1){
        VDP_waitVSync();
    }

       return (0);
}
Typical "Hello world" has not while() in tutorials. Maybe is because sgdk has change from old tutorials, don't know.

Re: SGDK CodeBlocks Setup issues

Posted: Sun Feb 10, 2019 8:34 pm
by Stef
Oh indeed you should never return from your code, i though the tutorial specifically mentionned that :)

Re: SGDK CodeBlocks Setup issues

Posted: Sun Feb 10, 2019 9:29 pm
by danibus
My mistake. I follow another sgdk tutorial I saw in another forum and first hello world was like this :oops:
Sorry guys

Re: SGDK CodeBlocks Setup issues

Posted: Mon Feb 11, 2019 8:55 am
by Stef
No worries ! Glad you were able to fix it :)
Hope you will have fun coding on your Megadrive ;)

Re: SGDK CodeBlocks Setup issues

Posted: Fri Jul 26, 2019 8:34 am
by ThatAn1meGuy
I’ve been trying to set up code blocks for the longest time but I keep getting this error