g2calc won't compile

I have tried to compile g2calc version 0.13 created by disciple:

# cd src
# make
yacc -d --report=solved --report=itemset expcalc_par.y
conflicts: 44 reduce/reduce
flex expcalc_tok.l
gcc -c -o y.tab.o y.tab.c
In file included from expcalc_par.y:129:
expcalc_tok.l: In function 'yylex':
expcalc_tok.l:53: error: 'tE' undeclared (first use in this function)
expcalc_tok.l:53: error: (Each undeclared identifier is reported only once
expcalc_tok.l:53: error: for each function it appears in.)
make: *** [y.tab.o] Error 1

Hmmm, I downloaded g2calc original source, it compiles, but it doesn't work -- I click buttons, nothing displays. Oh well.

Posted on 8 Jan 2010, 16:22


Posted on 8 Jan 2010, 17:32 by ttuuxxx
Hi Barry the orginal sources are located at http://ftp.uk.freesbie.org/sites/ftp.sourceforge.net/pub/sourceforge/g/project/g2/g2calc/g2calc/g2calc-alpha1/g2calc.tar.gz

V12 by disciple http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=14131 works if you compile it, you have to manually click the bin file in /scr. If you try to make a .desktop file it doesn't launch, if you run it via terminal it doesn't launch and gives a glade error that it can't find the glade file, only by clicking the bin it works. Very strange calculator.


Posted on 10 Jan 2010, 18:44 by disciple
Sorry Barry,
That's a remnant of my attempts to further improve the expression parsing, but I had a bit of a mixup when I uploaded that version. Very bad form.
It will compile if you delete that line from expcalc_tok.l:
"E" {yylval.double_t = 0; return tE;}

What I hope to do when I get a chance will actually farm everything but the gui out to an existing program, which is well tested and by a competent author. As well as providing arbitrary precision support, this will mean I won't have to worry that I might have stuffed up the maths somewhere and made it produce wrong answers :)

Your problem with the original source is interesting; I've had no problems across a lot of systems, except in Cygwin. I guess something is missing, faulty or incompatible in Qwerky. Does anything display if you use the precompiled binary? Do you know if other glade based programs are working? Galculator perhaps?

> only by clicking the bin it works

You've forgotten, Ttuuxxx :)
It just needs to be started from the right place in relation to the pixmaps and the glade file. It is an unfinished product and a couple of the things that it is lacking are a proper build system and the use of proper file paths :)
The original author wrote it partly because he couldn't find a calculator he liked, and partly to "learn gtk programming"...

Posted on 11 Jan 2010, 7:15 by BarryK
G2calc is faulty
There is nothing wrong with Quirky. Quirky is happy with other apps that use Glade.

I deleted that line, and it compiled, and it works. I get text in the window. However, if I change to the other glade file, that uses pixmaps, then g2calc once again does not work properly, i.e., no text.

Posted on 11 Jan 2010, 7:28 by BarryK
Glade error msg
With the normal glade file, g2calc starts and there are no error messages in the terminal. However if I use the glade-with-pixmaps file, then when I start g2calc, a heap of error messsages get displayed, one for each key, like this:

(g2calc:26155): libglade-WARNING **: could not find signal handler 'on_sqrt_button_clicked'.

Posted on 11 Jan 2010, 15:40 by disciple
I didn't update the pixmap glade file for my last version
Yes, my last version has generalised input functions (to save code and allow more flexibility for choosing buttons to put in a glade file) but I only updated the other glade file, not the one with pixmaps, so that currently does not work.

It is interesting that my version works but the original doesn't - my changes were mostly very minor and I didn't really change the underlying methods it was using.

Posted on 11 Jan 2010, 17:35 by disciple
that was because
FYI, the reason I didn't update the pixmap glade file is because I was only really interested in making a file that would include buttons for all the new functions I added, and I rather like the original pixmaps, but Sami (the original author) has forgotten what font he used. I mean to try to identify the font (apparently it was in the Debian version he had at the time), but haven't got around to that either.