0

For testing and fun purposes I downloaded the Shakespeare Programming language.

http://shakespearelang.sourceforge.net/

I tried to run the Makefile through make

and it spits out this result:

gcc grammar.tab.o scanner.o strutils.o -O2 -Wall -lfl -o spl2c
grammar.tab.o: In function `report_error':
grammar.tab.c:(.text+0x9): undefined reference to `yylineno'
grammar.tab.o: In function `report_warning':
grammar.tab.c:(.text+0x49): undefined reference to `yylineno'
grammar.tab.o: In function `yyparse':
grammar.tab.c:(.text+0x515): undefined reference to `yylex'
grammar.tab.c:(.text+0x682): undefined reference to `yylineno'
grammar.tab.c:(.text+0x708): undefined reference to `yylineno'
grammar.tab.c:(.text+0x7ce): undefined reference to `yylineno'
grammar.tab.c:(.text+0x882): undefined reference to `yylineno'
grammar.tab.c:(.text+0x8f6): undefined reference to `yylineno'
grammar.tab.o:grammar.tab.c:(.text+0x9aa): more undefined references to `yylineno' follow
collect2: error: ld returned 1 exit status
make: *** [spl2c] Error 1

Does anyone know what could be going wrong when trying to make?

I tried looking at this to resolve my issue but found nothing.

Barmar
  • 741,623
  • 53
  • 500
  • 612
Davis Keene
  • 213
  • 1
  • 5
  • 12
  • 1
    Going out on a limb, I would say you either lack the necessary parser support files (flex/bison/yacc, etc.) or they're the wrong versions from what this library expects. – 500 - Internal Server Error Apr 07 '17 at 01:08
  • The code is over 15 years old. Maybe there are compatibility issues with modern versions of flex and bison. – Barmar Apr 07 '17 at 01:10
  • See http://stackoverflow.com/questions/12541217/beginner-bison-flex regarding the `yylineno` variable in `bison/flex`. But since this isn't your own code, it's not clear what you can do about it. – Barmar Apr 07 '17 at 01:13
  • Try changing `LEXFLAGS` to `-Ceml`. – Barmar Apr 07 '17 at 01:16
  • I was able to get it to run, and I compiled the .spl into a .c file. However, it includes a custom header that gcc is unable to detect. How would I resolve this? – Davis Keene Apr 07 '17 at 01:30
  • @DavisKeene: spl.h is in the unpacked tarball, at the top level. You just need to add an -I option to your compile line. It would be useful to know the steps you took to unpack and compile the distribution; I didn't have any trouble compiling spl from the downloaded tarball. – rici Apr 07 '17 at 01:44
  • For the custom header (`#include `), you need either `CPATH=` or `gcc -I<...path..>` where `` is the full path to the directory containing `spl.h`. Also you need to do the same with `LIBRARY_PATH`, so that the linker can find `libspl.a`. – ShreevatsaR Jun 06 '17 at 22:22

0 Answers0