SGDK CodeBlocks Setup issues

SGDK only sub forum

Moderator: Stef

MrTamk1s
Very interested
Posts: 75
Joined: Sun Jan 04, 2015 10:27 pm
Location: Pennsylvania
Contact:

SGDK CodeBlocks Setup issues

Post by MrTamk1s » Sun May 15, 2016 2:35 am

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.
SGDK homebrew dev and Unity3D Indie dev.
Sega does what Nintendont!

L10N37
Newbie
Posts: 4
Joined: Wed May 18, 2016 5:40 am

Re: SGDK CodeBlocks Setup issues

Post by L10N37 » Sun Jun 12, 2016 4:08 am

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

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

Re: SGDK CodeBlocks Setup issues

Post by Stef » Sun Jun 12, 2016 10:10 am

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

MrTamk1s
Very interested
Posts: 75
Joined: Sun Jan 04, 2015 10:27 pm
Location: Pennsylvania
Contact:

Re: SGDK CodeBlocks Setup issues

Post by MrTamk1s » Wed Jun 29, 2016 10:13 pm

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.
SGDK homebrew dev and Unity3D Indie dev.
Sega does what Nintendont!

MrTamk1s
Very interested
Posts: 75
Joined: Sun Jan 04, 2015 10:27 pm
Location: Pennsylvania
Contact:

Re: SGDK CodeBlocks Setup issues

Post by MrTamk1s » Wed Jul 20, 2016 12:07 am

Did everything Lion say to do, and got Code::Blocks 16.01 to compile again with my project :). Thanks!
SGDK homebrew dev and Unity3D Indie dev.
Sega does what Nintendont!

danibus
Very interested
Posts: 135
Joined: Sat Feb 03, 2018 12:41 pm

Re: SGDK CodeBlocks Setup issues

Post by danibus » Fri Feb 08, 2019 1:25 pm

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!

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

Re: SGDK CodeBlocks Setup issues

Post by Stef » Fri Feb 08, 2019 3:47 pm

Can you post the log of the compilation process from the C::B output ?

danibus
Very interested
Posts: 135
Joined: Sat Feb 03, 2018 12:41 pm

Re: SGDK CodeBlocks Setup issues

Post by danibus » Sat Feb 09, 2019 9:14 am

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))

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

Re: SGDK CodeBlocks Setup issues

Post by Stef » Sat Feb 09, 2019 10:04 am

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).

danibus
Very interested
Posts: 135
Joined: Sat Feb 03, 2018 12:41 pm

Re: SGDK CodeBlocks Setup issues

Post by danibus » Sat Feb 09, 2019 12:28 pm

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 11529 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

danibus
Very interested
Posts: 135
Joined: Sat Feb 03, 2018 12:41 pm

Re: SGDK CodeBlocks Setup issues

Post by danibus » Sun Feb 10, 2019 12:43 pm

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.

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

Re: SGDK CodeBlocks Setup issues

Post by Stef » Sun Feb 10, 2019 8:34 pm

Oh indeed you should never return from your code, i though the tutorial specifically mentionned that :)

danibus
Very interested
Posts: 135
Joined: Sat Feb 03, 2018 12:41 pm

Re: SGDK CodeBlocks Setup issues

Post by danibus » Sun Feb 10, 2019 9:29 pm

My mistake. I follow another sgdk tutorial I saw in another forum and first hello world was like this :oops:
Sorry guys

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

Re: SGDK CodeBlocks Setup issues

Post by Stef » Mon Feb 11, 2019 8:55 am

No worries ! Glad you were able to fix it :)
Hope you will have fun coding on your Megadrive ;)

ThatAn1meGuy
Newbie
Posts: 1
Joined: Thu Aug 30, 2018 11:18 pm

Re: SGDK CodeBlocks Setup issues

Post by ThatAn1meGuy » Fri Jul 26, 2019 8:34 am

I’ve been trying to set up code blocks for the longest time but I keep getting this error
Attachments
AA5087A5-BD21-4E70-9458-651F610F57C9.jpeg
The Error
AA5087A5-BD21-4E70-9458-651F610F57C9.jpeg (51.1 KiB) Viewed 10291 times
Last edited by ThatAn1meGuy on Sat Jul 27, 2019 8:32 am, edited 1 time in total.

Post Reply