Jump to content



0

Compiling in linux


23 replies to this topic

#1 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Sat Apr 2, 2011 12:04 AM

Hey, i just edited my game that i made and i use linux now so i can't use visual bb and i need to compile. the Batari Basic Compiler on the website is very complicated and i need help.



thanks!


Esplonky

#2 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Sat Apr 2, 2011 9:58 AM

One way...

  • Make a /home/bB directory to hold bB: sudo mkdir -p /home/bB
  • Download the 1.1 beta from here. Unzip it to your /home/bB directory, making sure that subdirectories are created.
  • Download the bB linux binaries from here. Extract them to your /home/bB directory.
  • Create a directory for a new project anywhere. Somewhere in your home directory might be a good place.
  • download the zip I've attached below and unzip it into your new project directory.

Then open a command prompt and "cd" into your project directory. From there, type one of the following, without the quotes:

    "make"
      Builds mygame.bas.bin from mygame.bas. This only reports success if the output binary is a multiple of 2k.
    "make run"
      Launches mygame.bas.bin in stella.
    "make clean"
      Deletes mygame.bas.bin and all of the extra files the build process creates.
    "make backup"
      Creates a tarball backup of every file in the project directory. The filename contains the day's date, so backups from previous days aren't overwritten.

You can rename the basic file and edit the first line of the Makefile to change "mygame" to anything you want.

Attached Files



#3 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Sun Apr 3, 2011 10:48 AM

Nice! Thanks!!

#4 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Sun Apr 3, 2011 9:13 PM

doesn't seem to be working.i keep getting "error 1" at the end

#5 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 4:31 AM

Can you copy and paste the full output?

I've never seen an "error 1", so it would help to see what led up to it.

#6 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 3:37 PM

[esplonky@Esplonky desandojoe]$ make
2600basic.sh default.bas -O
make: 2600basic.sh: Command not found
make: *** [default.bas.bin] Error 127
[esplonky@Esplonky desandojoe]$ cd..
bash: cd..: command not found...
cd[esplonky@Esplonky desandojoe]$ cd..
bash: cd..: command not found...
cd[esplonky@Esplonky desandojoe]$ cd /home/esplonky/Bb
[esplonky@Esplonky Bb]$ make
cc -O2 -o 2600basic 2600bas.c statements.c keywords.c
2600bas.c: In function ‘main’:
2600bas.c:139:6: error: too few arguments to function ‘getline’
/usr/include/stdio.h:673:20: note: declared here
2600bas.c:177:5: error: too few arguments to function ‘getline’
/usr/include/stdio.h:673:20: note: declared here
statements.c: In function ‘getline’:
statements.c:1260:1: error: number of arguments doesn’t match prototype
/usr/include/stdio.h:673:20: error: prototype declaration
make: *** [2600basic] Error 1

#7 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 4:40 PM

Ok, it looks like you didn't put bB itself in /home/bB like the instructions said, so the project Makefile couldn't find 2600basic.sh, which is in the official bB directory.

Since you've put the official bB directory somewhere else, you'll need to adjust the line in your project's Makefile that currently reads "export bB=/home/bB" to "export bB=/home/esplonky/Bb".

No need to run "make" in the official bB directory. You'd do this if you wanted to rebuild bB itself, but there's no need to do that since the instructions asked you to download the pre-built Linux binaries.

#8 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 4:57 PM

ok, ill try this now

#9 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 4:58 PM

it will not let me move the bb files to the new bb directory, somehow i wasnt set as administrator and im the only user on this computer.

#10 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 5:11 PM

/home/esplonky/Desktop/pix/screenshot2000.png

#11 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 5:12 PM

oops, my bad

#12 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 5:13 PM

it just gives me an error and says 'permission denied'

#13 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 5:25 PM

View Postesplonky, on Mon Apr 4, 2011 5:13 PM, said:

it just gives me an error and says 'permission denied'

Most modern OSes give you a user without any privilege, and you need to bump up your rights when you want to do administrative stuff. It's a security thing.

In Linux you can bump up your rights with "sudo". Try the following, typing in esplonky's password when prompted...

    sudo mv /home/esplonky/Bb /home/bB

...this will put the bB directory in the right place, so you won't have to edit my Makefile.

#14 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 5:45 PM

now i get error 127


2600basic.sh default.bas -O
make: execvp: 2600basic.sh: Permission denied
make: *** [default.bas.bin] Error 127

#15 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 5:49 PM

It sounds like the permissions are off. Try this...

    sudo chmod -R 755 /home/bB
...and then try the make again.

#16 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 5:53 PM

so i am logged in as root in the /home/bB directory. in my bB directory, i have all the batari BASIC files you told me to download, and i have the project folder with default.bas and the makefile that has this code:


export PROJECT=default
export bB=/home/bB
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:.:${bB}
export COMPILER=2600basic.sh
export HOME=${PWD}

main: ${PROJECT}.bas.bin

${PROJECT}.bas.bin: ${PROJECT}.bas
${COMPILER} ${PROJECT}.bas -O
@ [ `du -sb ${PROJECT}.bas.bin | cut -f1 | awk '{print $$1 % 2048}'` = 0 ] || rm ${PROJECT}.bas.bin
@ ( [ -r ${PROJECT}.bas.bin ] && echo "\n /|\\" ${PROJECT}.bas compiled successfully" /|\\ \n" ) || echo "\n >:( >:( >:( Compile of ${PROJECT}.bas FAILED! >:( >:( >:(\n"

clean:
/bin/rm -f ${PROJECT}.bas.bin ${PROJECT}.bas.asm ${PROJECT}.bas.dump includes.bB bB.asm 2600basic_variable_redefs.h

run:
stella ${PROJECT}.bas.bin

debug:
mkdir .stella 2>/dev/null || true
echo "breakif {_scan>#262}" > .stella/autoexec.stella
stella -break "*($fffc)" ${PROJECT}.bas.bin

backup: clean
tar -cvzf ${PROJECT}-`date +%Y%m%d`-backup.tgz --exclude=\*tgz *

#17 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 6:04 PM

View Postesplonky, on Mon Apr 4, 2011 5:53 PM, said:

so i am logged in as root in the /home/bB directory. in my bB directory, i have all the batari BASIC files you told me to download, and i have the project folder with default.bas and the makefile that has this code...
Even if you're in as root, you still need to make the bB files executable...

    chmod -R 755 /home/bB
...then "cd" to your project directory with the Makefile and basic file and try a "make".

#18 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 6:13 PM

"make"
2600basic.sh default.bas -O
Starting build of default.bas
(3): Error: Unknown keyword: =

Compilation failed.
du: cannot access `default.bas.bin': No such file or directory
/bin/sh: line 0: [: =: unary operator expected
rm: cannot remove `default.bas.bin': No such file or directory
make: *** [default.bas.bin] Error 1

#19 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 6:16 PM

Post your default.bas as an attachment. The bB compiler doesn't like the third line.

#20 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 6:21 PM

ok,i found out all the bugs and fixed them and compiled succsessfully. thx rev eng!

#21 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Mon Apr 4, 2011 7:01 PM

No problem. Glad you're up and running!

#22 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Mon Apr 4, 2011 7:26 PM

i just need something like img2code for linux. do u think the vbb verison will work under WINE?

#23 jwierer ONLINE  

jwierer

    Dragonstomper

  • 746 posts
  • Location:Seattle,WA

Posted Mon Apr 4, 2011 8:06 PM

View Postesplonky, on Mon Apr 4, 2011 7:26 PM, said:

i just need something like img2code for linux. do u think the vbb verison will work under WINE?
I built a version of img2code for .NET2.0 and it works, but with UI issues.

Attached File  ImgtoCode_WINE.zip   47.64K   19 downloads

-Jeff

Edited by jwierer, Mon Apr 4, 2011 8:10 PM.


#24 esplonky OFFLINE  

esplonky

    Moonsweeper

  • 292 posts
  • Kinetic, Not synthetic.
  • Location:Canyon Lake, TX

Posted Thu Apr 7, 2011 5:12 PM

thanks a bunch!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users