Troubles getting BaCon / HUG / GLADE / GLUT working

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
afishe2000
Posts: 37
Joined: Fri 29 Jan 2010, 16:09

Troubles getting BaCon / HUG / GLADE / GLUT working

#1 Post by afishe2000 »

I hope it is OK to start a new thread dealing with "installing and setting up" BaCon, HUG, GLADE, and GLUT.

The original thread has much more about development and use and I'm just not there yet.

Here is the info from my eee PC 900:
Linux puppypc 2.6.35.7 (puppeee 4.4 Beta 5)
BaCon version 1.0 build 19 - BASH - (c) Peter van Eerten - GPL v3.
gcc (GCC) 4.2.2
GNU bash, version 3.00.16(1)-release (i486-t2-linux-gnu)
GTK-2.0


I have BaCon up and running as a bash script and can compile and run most of the "Test Programs" with some slight modifications.

When I try a HUG example I usually get:
ERROR: could not parse line 201 in file 'hug.bac'!
which equates to:
gtk_init(0, 0) or other gtk commands.

I am just guessing that maybe my version of GTK isn't quite up to speed for all GUI work I want to do. I read the other thread and didn't see anything specific to that, and with BaCon compiling the Test Programs I didn't think it was a BASH 4.0+ problem.

Any help would be appreciated. I'm a quick learner once I have the right tools and I would like to rewrite some of the gtk-dialog programs I've done recently.

Thanks,

noryb009
Posts: 634
Joined: Sat 20 Mar 2010, 22:28

#2 Post by noryb009 »

Do you have BASH 4? I think the command is

Code: Select all

bash --version

User avatar
piratesmack
Posts: 100
Joined: Wed 16 Sep 2009, 14:22

Re: Troubles getting BaCon / HUG / GLADE / GLUT working

#3 Post by piratesmack »

afishe2000 wrote: I am just guessing that maybe my version of GTK isn't quite up to speed for all GUI work I want to do.
I don't know, I think that would only cause it to fail during the compilation stage, but it's failing during conversion. Have you tried compiling bacon.bac and using that instead?

Code: Select all

bash bacon.bash bacon.bac
Note: if bacon.bac fails to compile, you can use Barry's pet package:
http://bkhome.org/blog/?viewDetailed=02007

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#4 Post by big_bass »

Hey afishe2000

you will need to upgrade bash to 4

then this script will get and keep things updated this is the latest beta HUG
this will take about 5 minutes fully automatic
good to see that your are interested in bacon

*you can manually add GLADE, and GLUT. to this script


Joe

Code: Select all

#!/bin/bash


# Joe Arose  big_bass 12-14-2010
# call this  auto-build-compile-bacon
# auto download compile install  
# so you can easily update when needed

# thanks "mechanic" for the speed tip  using bacon instead of bacon.bash for compiling

# thanks seaside for the bash version test
# added syntax highlighting


BASHV=$(bash --version | head -1)
VN=$(echo $BASHV | cut -f1 -d. | sed 's/^.*\(.\)$/\1/')
[ $VN -lt 4 ] && Xdialog --title "bash version test " \
           --infobox "\nBash Version Problem $BASHV installed
---------------> Bash must be version 4 or above for BaCon <-------------------" "\n" 0 0





#   =====================================
#    downoad ,compile and install BaCon
#   =====================================


Xdialog --wrap --title "bacon instlaller" \
        --yesno "Do you want to install bacon  " 0 0

case $? in
  0)
    echo "Yes chosen."
   


rm -f  bacon.bash*
rm -f  bacon.bac*
rm -f  bacon
rm -f  hug.bac*
rm -f  bacon.lang*


xterm  -geometry 40x30+150+40 -e wget http://www.basic-converter.org/bacon.bash
chmod a+x bacon.bash


xterm  -geometry 40x30+150+40 -e wget http://www.basic-converter.org/bacon.bac
chmod a+x bacon.bac


xterm  -geometry 40x30+150+40 -e ./bacon.bash bacon.bac

# copy bacon bin into the path
cp bacon /usr/sbin



xterm  -geometry 40x30+150+40 -e wget http://www.basic-converter.org/beta/hug.bac

chmod a+x hug.bac

xterm  -geometry 40x30+150+40 -e bacon hug.bac

Xdialog --title "Complete" \
           --infobox "\nInstalling bacon has finished.\n" 0 0 3000


   ;;
  1)
    echo "No chosen."
    exit
   ;;
  255)
    echo "Box closed."
    exit
   ;;

esac


#   =====================================
#    syntax highlighting
#   =====================================

#(0) download the file http://www.basic-converter.org/bacon.lang
     

    xterm  -geometry 40x30+150+40 -e wget http://www.basic-converter.org/bacon.lang

#(1) Create language directory for GtkSourceView:

    mkdir -p ~/.local/share/gtksourceview-2.0/language-specs/

#(2) Copy this file to the new directory:

    cp bacon.lang ~/.local/share/gtksourceview-2.0/language-specs/

#Now start gedit, Anjuta, Scribes etc and the BaCon sourcecode has
#   syntax highlighting!



Xdialog --title "syntax highlighting" \
           --infobox "\nsyntax highlighting has installed.\n" 0 0 3000


afishe2000
Posts: 37
Joined: Fri 29 Jan 2010, 16:09

#5 Post by afishe2000 »

Continuing saga,

I've downloaded BASH4, compiled and have it up and running:

# bash --version
GNU bash, version 4.1.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>


I download and ran the .pet for BaCon and have the latest version

# /usr/bin/bacon -v
BaCon version 1.0 build 20 - (c) Peter van Eerten - GPL v3.

BaCon is integrated into Geany and for now I'm just using filetype.FreeBasic for syntax highlighting.

The HUG programs will compile without errors.

I'm using the Password Manager program as my test1.bac.

When I try:

# ./test1
ERROR: signal for SEGMENTATION FAULT received - memory invalid or array out of bounds? Try to compile the program with TRAP LOCAL to find the cause.

I assume the TRAP LOCAL is an option for gcc and not BaCon?

I haven't done any command line compiling in probably two decades so my memory is pretty fuzzy on all of this. Everyone's help is very appreciated.

Thanks,

Jeff

2lss
Posts: 225
Joined: Sun 20 Sep 2009, 23:54

#6 Post by 2lss »

Are you downloading the code or copy/pasting?

I have had problems (similar to yours), because I was copying the code from the website and then pasting it into a text file.

From what I can tell, the problem is a webkit issue. Somehow the spaces are not recognized as characters. I don't have the issue using a mozilla browser.

Try this. Download Peter's file-fetch program.

Code: Select all

wget http://www.basic-converter.org/fetch.bac 
Compile this with bacon and then run it. It will download all of the text files from www.basic-converter.org directly, to avoid any issues.

My thread:
http://basic-converter.proboards.com/in ... &thread=48

EDIT: Also, puppeee 4.4 has bash 4 by default in the devx, its just renamed. I think its "bash4"

afishe2000
Posts: 37
Joined: Fri 29 Jan 2010, 16:09

#7 Post by afishe2000 »

THANK YOU!

That was it - examples are up and running, extremely cool.

Coding questions to follow, I'm sure...

Jeff

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

compilation

#8 Post by vovchik »

Dear afishe2000,

Thanks to Peter, Joe, 2lss, piratesmack and a few others, you are up and running. Great!

With kind regards,
vovchik

PS. I forgot Doyle and Barry and a few others. No offence intended, ladies and gents. Mea culpa.

Post Reply