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.

#1 2012-05-19 21:24:50

frarees
New member
Registered: 2012-05-19
Posts: 1

Cannot compile GBDK 2.96a on OSX

I've read in the Wiki that there's no official Mac OS X support.

However, I just ran "make":

SDCC.y: In function ‘yyparse’:
SDCC.y:1007: error: label at end of compound statement
make[2]: *** [SDCCy.o] Error 1
make[1]: *** [sdcc-cc] Error 2
make: *** [sdcc-build] Error 2

So I've checked SDCC.y at line 1007, and added a "break;" statement to fix it. Ran "make" again:

SDCC.lex:45: error: redefinition of ‘yylineno’
<stdout>:342: error: previous definition of ‘yylineno’ was here
SDCC.lex:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘YY_PROTO’
make[2]: *** [SDCClex.o] Error 1
make[1]: *** [sdcc-cc] Error 2
make: *** [sdcc-build] Error 2

Time to check SDCC.lex at lines 45 and 50.

45: int   yylineno = 1               ;

It's a redefinition of a variable issue, so let's bypass it now by simply deleting that line.

50: int yywrap YY_PROTO((void))

Here the thing is kinda more complicated for me. yywrap seems like a preprocessor macro used to dynamically link or something like, so if I just change this line like this:

int YY_PROTO(void)

It gives me a undefined symbol:

Undefined symbols for architecture x86_64:
  "_yywrap", referenced from:
      _input in SDCClex.o
      _yylex in SDCClex.o
ld: symbol(s) not found for architecture x86_64

I don't know what to do next. Any help is appreciated. Thanks!

Offline

 

#2 2014-07-30 20:33:19

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Cannot compile GBDK 2.96a on OSX

i dont know how to compile for mac
but you coud try a program called wine that runs windows programs on
non windows operating systems
but if that dose not work try running windows in virtualbox and compiling in there
and if you dont have a windows 7 install disk
windows xp install disks are very cheap on ebay
and  it runs on ms-dos as well
so you could try downloading a ms-dos boot disk and writing to a floppy or just
downloading the ms-dos floppy files and installing them on virtualbox
there are many youtube tutorails off how you get it working!
also you could install linux(which is free)
on virtualbox and install gbdk on there

here are some usefull links:
http://gbdk.sourceforge.net/install.html//how to install
https://www.youtube.com/watch?v=tGYDXoK4EZo//ms-dos virtualbox tutorial
http://www.intowindows.com/how-to-insta … rtualbox// windows 7 virtualbox tutorial
https://www.youtube.com/watch?v=QkJmahizwO4//ubuntu virtualbox tutorial

some good linux distros for virtualbox:
http://lubuntu.net
http://linuxmint.com/
http://www.tinycorelinux.net
http://www.ubuntu.com/

also incase your wondering how to compile from the command line you
goto the bin directory and type
lcc -o program.gb program.c
you then run the .gb file in an emulator

i even found this mac emulator but be carefull for viruses (yes macs can get viruses)
http://coolrom.com/emulators/mac/10/Vis … dvance.php

Last edited by a cat (2014-07-30 20:43:30)


a cat in need of knowledge!!

Offline

 

#3 2014-08-01 05:09:03

LuckyLights
Member
Registered: 2014-07-06
Posts: 20

Re: Cannot compile GBDK 2.96a on OSX

Hi frarees

I tried to compile gbdk for osx too with out success. Change around a lot of source only to find my self missing objects.
I was running gbdk on a ubuntu dist in parallels until i found this: http://gbdev.gg8.se/forums//viewtopic.php?id=86 http://www.rpgmaker.it/proflame/gbdk.zip

Cred to ProGM i have no idea of how he got it to compile. But the binaries works fine for me.

Offline

 

#4 2014-08-01 15:11:59

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: Cannot compile GBDK 2.96a on OSX

How did you compile on Ubuntu?
I always get errors when trying


a cat in need of knowledge!!

Offline

 

#5 2014-08-05 04:02:34

andreai
Member
Registered: 2014-07-28
Posts: 21

Re: Cannot compile GBDK 2.96a on OSX

Hi guys, posting this other thread (where I pretty much talk to myself), I'm also on Os X and on the second post I go through my current setup and experience with the different versions of GBDK:
http://gbdev.gg8.se/forums/viewtopic.php?pid=695#p695

Offline

 

#6 2014-08-10 00:18:22

MatthewCallis
New member
From: Seattle, Washington
Registered: 2014-08-10
Posts: 2

Re: Cannot compile GBDK 2.96a on OSX

Just wanted to update this for anyone else, I have successfully built and compiled gbdk on OS X 10.10 DP5 using https://github.com/co-me/gbdk as a base, make sure to check out the issues I filed if you try it as well.

Last edited by MatthewCallis (2014-08-10 00:18:37)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson