Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2016-09-09 19:28:19

w00tguy
New member
Registered: 2016-09-08
Posts: 3

GBDK - Unable to compile "banked" exmple

I was recently using gbdk-n and liking it, until I realized my code would grow beyond 32kb. Transparently banked function calls don't work yet with that project, so now I'm now switching to the 15 year-old GBDK 2.95.

The problem is, I can't get the "banked" example to compile. This specific example uses the sdcc compiler instead of lcc. Anything I try to compile with sdcc results in these errors:

Code:

C:\dev\gbdk\examples\gb\banked>..\..\..\bin\sdcc -v --asm=rgbds -c main.c
sdcpp -Wall -lang-c++ -DSDCC=1 -I/gbdk/include -DSDCC_STACK_AUTO -DSDCC_MODEL_SMALL -DSDCC_gbz80 main.c \s8gq4.
sdcpp: error: unrecognized command line option "-lang-c++"
sdcpp: fatal error: opening output file \s8gq4.: Invalid argument
Preproc file not found
: No such file or directory

Every time I compile, the "\s8gq4" text changes (maybe this is a random object name chosen for the c file?). I also can't seem to change the command-line for sdcpp - it's injecting "-lang-c++" and that random text for some reason.

Compiling the banked example on Linux using "make" results in a segmentation fault. All of the other examples work fine.

Has anyone been able to get this example to work? If not, is transparently banked code possible with lcc instead of sdcc? I know the old banked sample works, but it requires you to do bank switching yourself, and I'm pretty sure it doesn't support nested banked calls.

Offline

 

#2 2016-09-12 09:36:54

Tag365
Member
Registered: 2016-06-01
Posts: 41

Re: GBDK - Unable to compile "banked" exmple

I have never seen such an error like the ones you have reported, nor have I used those arguments for the command line to compile the script. I have no idea on how to fix your problem.

Offline

 

#3 2016-09-12 17:12:39

w00tguy
New member
Registered: 2016-09-08
Posts: 3

Re: GBDK - Unable to compile "banked" exmple

As long as it's just "my" problem and others can compile the example just fine, then that's good news. The command I used is copied from the Makefile, minus the redundant "-mgbz80".

I'm learning how to handle manual bank switching instead now (using the latest SDCC). I figure I'll need to do that anyway since the code will need to run on other consoles with banked memory and limited compiler support (e.g. NES + cc65).

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson