Page 1 of 1

Troubles getting BaCon / HUG / GLADE / GLUT working

Posted: Sun 12 Dec 2010, 22:55
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,

Posted: Mon 13 Dec 2010, 02:01
by noryb009
Do you have BASH 4? I think the command is

Code: Select all

bash --version

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

Posted: Mon 13 Dec 2010, 02:54
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

Posted: Mon 13 Dec 2010, 04:17
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


Posted: Tue 14 Dec 2010, 15:13
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

Posted: Wed 15 Dec 2010, 21:41
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"

Posted: Wed 15 Dec 2010, 22:36
by afishe2000
THANK YOU!

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

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

Jeff

compilation

Posted: Wed 15 Dec 2010, 22:40
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.