SGDK CodeBlocks Linux

SGDK only sub forum

Moderator: Stef

Post Reply
jambonbill
Newbie
Posts: 7
Joined: Tue May 21, 2019 2:59 am
Location: Hong Kong
Contact:

SGDK CodeBlocks Linux

Post by jambonbill » Tue Oct 15, 2019 8:15 am

I'm new to SGDK and trying to configure Codeblocks.

I found https://github.com/Stephane-D/SGDK/wiki ... CodeBlocks
but its quite "windows" specific :

Image

Can anyone help me to setup the compiler ?
i have gendev installed at its default location : /opt/gendev

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

Re: SGDK CodeBlocks Linux

Post by Chilly Willy » Tue Oct 15, 2019 8:44 pm

Can't help with CodeBlocks, but I can help with Geany. Geany is a lighter editor... comparable to CodeLite. In Geany, go to the Build menu and select Set Build Commands. Then in the Independent Commands, for Make, set the command field to "export GENDEV=/opt/gendev; make -f $GENDEV/sgdk/mkfiles/makefile.gen clean all" (without the quotes). Set the working directory field to "%d" (without the quotes). Then in Execute Commands for Execute, set the command field to your favorite emulator. Then you build the project by loading any file in the main directory of the project and clicking the Brick icon in the toolbar. You'll get a printout of the results in the console window on the bottom of the Geany window. Once you've got it to build successfully, click the gears icon next to the brick to run the emulator. If your emulator accepts a command line option for the rom file, put that in the Execute command field with the path to the rom being "%d/out/rom.bin" (without the quotes). I just did this on my own system using gendev/examples/3d_example/main.c as the file loaded.

Image

jambonbill
Newbie
Posts: 7
Joined: Tue May 21, 2019 2:59 am
Location: Hong Kong
Contact:

Re: SGDK CodeBlocks Linux

Post by jambonbill » Wed Oct 16, 2019 2:17 am

Thank you !
I didn't know Geany, but i like it already :D

i have configured the build option as per your screenshot, but the compiler is unhappy.

i assume that i'm supposed to configure the "Compile/Build C commands" part as well,
but i see on your screenshot that you left the default gcc values...

Image

hotrodx
Very interested
Posts: 50
Joined: Thu Mar 21, 2019 1:23 pm

Re: SGDK CodeBlocks Linux

Post by hotrodx » Wed Oct 16, 2019 8:56 am

I don't use Linux for SGDK development, but if it's anywhere similar to Windows, you should run the MAKE script, and not Compile or Build.

You might need to configure your IDE for include paths as well, if it has anything like Intellisense or Autocomplete.

jambonbill
Newbie
Posts: 7
Joined: Tue May 21, 2019 2:59 am
Location: Hong Kong
Contact:

Re: SGDK CodeBlocks Linux

Post by jambonbill » Wed Oct 16, 2019 9:19 am

ahhh right... stupid me, so that was it, it actually "make" just fine.
thanks for the clarification.

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

Re: SGDK CodeBlocks Linux

Post by Chilly Willy » Wed Oct 16, 2019 1:08 pm

I was going to say, if the Build icon isn't working, click the triangle next to it and select Make All. After doing that once, clicking on Build did that afterwards. Technically, the only things I set were the Make and the Execute as they were all I needed for this. So you need to make sure you are Making and not GCCing. :lol:

Anywho, that was much easier to set that all the CodeBlocks stuff. I've always liked Geany. Been using it for about a decade now, and haven't found anything I like better. I used CodeBlocks before Geany, but it kept getting bigger and heavier, adding stuff I never used, and complicating everything I did until I got sick of it. :cry:

jambonbill
Newbie
Posts: 7
Joined: Tue May 21, 2019 2:59 am
Location: Hong Kong
Contact:

Re: SGDK CodeBlocks Linux

Post by jambonbill » Sat Oct 19, 2019 4:38 am

I just realised that i could use Sublimetext for my megadrive needs.

it's also very easy to setup.

for those who are interested, all you need to do is to create a .system-build file, like this one :

Code: Select all

{
        "shell_cmd": "make -f /opt/gendev/sgdk/mkfiles/makefile.gen && gens out/rom.bin"
}
and hit Ctrl+B to build your project.

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

Re: SGDK CodeBlocks Linux

Post by Chilly Willy » Sat Oct 19, 2019 1:09 pm

My issue with sublime is the use of non-standard control keys. That was one of the things that drew me to Geany in the first place. This isn't the 1980s - key combos have been standardized for decades now.

jambonbill
Newbie
Posts: 7
Joined: Tue May 21, 2019 2:59 am
Location: Hong Kong
Contact:

Re: SGDK CodeBlocks Linux

Post by jambonbill » Mon Oct 21, 2019 7:49 am

What key combos ? I'm probably missing something : )

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

Re: SGDK CodeBlocks Linux

Post by Chilly Willy » Mon Oct 21, 2019 6:01 pm

Well, right off the bat, Ctrl-P is not print. There are others...

While I'm not adverse to learning custom key mappings, to do so just for a text editor automatically gives it a strike.

Post Reply