LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Pcalc make error : yacc or pcalc.o missing ?? (https://www.linuxquestions.org/questions/linux-software-2/pcalc-make-error-yacc-or-pcalc-o-missing-786540/)

Winkel 02-02-2010 05:36 PM

Pcalc make error : yacc or pcalc.o missing ??
 
I had the following error while trying to install pcalc in Debian.
I have bison and flex installed, and looking at the files it looks like there might be a problem with yacc being removed from the Debian library. I'm a newbie but am trying to learn about memory
registration and interaction with the CPU. This program could really help if I could get it to install!
Here's my log:

User:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 5.0.3
Release: 5.0.3


User:~# cd /home/user/Desktop/pcalc
User:/home/user/Desktop/pcalc# ls
pcalc-000 pcalc-000.tar.gz
User:/home/user/Desktop/pcalc# cd pcalc-000
User:/home/user/Desktop/pcalc/pcalc-000# ls
convert.c help.h pcalc.c pcalc.map print.c skeleton.h symbol.h
convert.h hocdecl.h pcalc.h pcalc.old print.h store.c testdat
DISCAIMER Makefile pcalcl.c pcalc.tab.c ptest store.h testdata
EXAMPLE math.c pcalcl.l pcalc.tab.h README str.c testorig
funct.c pack pcalc.lsm pcalc.txt skelcom.h str.h win32
help.c pcalc pcalc.mak pcalc.y skeleton.c symbol.c


User:/home/user/Desktop/pcalc/pcalc-000# make
cc -c -o pcalc.o pcalc.c
flex -opcalcl.c pcalcl.l
pcalcl.l:290: warning, rule cannot be matched
cc -c pcalcl.c -o pcalcl.o
pcalcl.c:701:25: error: macro "yywrap" passed 1 arguments, but takes just 0
make: *** [pcalcl.o] Error 1

User:~# flex -V
flex 2.5.35
User:~# bison -V
bison (GNU Bison) 2.3


I would really appreciate the help! Thanks and have a great day!

colucix 02-02-2010 06:04 PM

Hi and welcome to LinuxQuestions!

Hmmm... I don't know exactly what's going on with the yywrap error, but the software you're trying to install is 12 years-old. Luckily, they released a new version that can be downloaded from the pcalc project at Sourceforge.

Winkel 02-03-2010 04:49 AM

LZMA SetDecoderProperties() error
 
Thanks Guru... I had also tried to install pcalc-2.tar.lzma from sourceforge.net. LZMA was giving a problem:

user@Debian:~/Desktop/pcalc/pcalc2$ ls
pcalc-2.tar.lzma
user@Debian:~/Desktop/pcalc/pcalc2$ lzma -cdfk pcalc-2.tar.lzma
lzma: SetDecoderProperties() error

I've seen some detailed code on the internet that seems to setup this missing or incorrect value properly. Again, I can't read code that well yet.

http://sourceforge.net/projects/seve.../topic/3047842

I also downloaded the file onto my Windoze machine and it unzipped fine with 7-zip. But I'm typing something wrong:

user@Debian:~/Desktop/pcalc/pcalc2$ 7zr -e pcalc-2.tar.lzma


Error:
Incorrect command line
noam@Debian:~/Desktop/pcalc/pcalc2$

I'd like to figure out my LZMA problem so I can use it in the future correctly. Thanks a millie'

Dr_P_Ross 02-03-2010 05:03 AM

You might also like to try the calc program, available from
http://isthe.com/chongo/tech/comp/calc/.

It is a very powerful arbitrary-precision programmable, command-line-driven calculator that handles binary, hex etc too. For example:
Quote:

% calc
C-style arbitrary precision calculator (version 2.12.3.3)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]

; 0x1234 + 0x20
4692
; config("mode2", "hex")
"off"
; 0x1234 + 0x20
4692 /* 0x1254 */
;
(the config command returns the previous setting). Lots of built-in help too.

Winkel 02-03-2010 08:44 AM

Problem solved, steps I took
 
Thanks Colucix and Dr Ross.

I was able to fix the problem and got Pcalc-2 running properly!

Solution:

1) Downloaded pcalc-2.tar.lzma from windows machine
2) Unzipped with 7 zip leaving pcalc-2.tar in place
3) FTP uploaded the directory to my virtual server
4) FTP Downloaded the files individually to my Debian home box
5) cd into the directory
6) make

terminal output:

bison -ld -o pcalc.c pcalc.y
pcalc.y: conflicts: 67 shift/reduce, 37 reduce/reduce
pcalc.y:73.13-16: warning: rule never reduced because of conflicts: list: list
cc -ggdb -Wall -DVERSION='"2"' -c -o pcalc.o pcalc.c
cc -ggdb -Wall -DVERSION='"2"' -c -o pcalcl.o pcalcl.c
pcalcl.c:1870: warning: âyyunputâ defined but not used
pcalcl.c:1913: warning: âinputâ defined but not used
cc -ggdb -Wall -DVERSION='"2"' -c -o funct.o funct.c
cc -ggdb -Wall -DVERSION='"2"' -c -o math.o math.c
cc -ggdb -Wall -DVERSION='"2"' -c -o symbol.o symbol.c
cc -ggdb -Wall -DVERSION='"2"' -c -o help.o help.c
cc -ggdb -Wall -DVERSION='"2"' -c -o store.o store.c
cc -ggdb -Wall -DVERSION='"2"' -c -o print.o print.c
cc -ggdb -Wall -DVERSION='"2"' -c -o str.o str.c
cc -ggdb -Wall -DVERSION='"2"' -c -o convert.o convert.c
cc pcalc.o pcalcl.o funct.o math.o symbol.o help.o store.o print.o str.o convert.o -lm -lfl -o pcalc

7) make install

Debian:/home/user/Desktop/pcalc/thepcalc2# make install
install -m 755 -D pcalc /usr/bin/pcalc

8) Solved!

Debian:/home/user/Desktop/pcalc/thepcalc2# pcalc

Programmer's calculator by Peter Glen. Version 2

For functions type pcalc f
For controls type pcalc l
For operators type pcalc o
For constants type pcalc c

colucix 02-03-2010 04:25 PM

Glad to see the problem solved. Cheers! :)


All times are GMT -5. The time now is 11:37 PM.