kylelemons / lolcode-ctools

Automatically exported from code.google.com/p/lolcode-ctools
0 stars 0 forks source link

Enter one-line summary #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. As per the instructions on the LOLCode site, I cd to lcc and make

I get:

mathieu-tozers-macbook-2:lcc mathieutozer$ make
bison -v -d -k -o grammar.tab.c --defines=grammar.tab.h grammar.y
flex -o lex.yy.c lexer.l
  CC      lex.yy.o
gcc -Wall -Werror -fPIC -ggdb -c lex.yy.c
lexer.l:5:20: error: malloc.h: No such file or directory

I am using OS X, is it supported?

Original issue reported on code.google.com by mathieut...@gmail.com on 21 Jun 2007 at 11:25

GoogleCodeExporter commented 9 years ago
I too am on OSX (10.4.11 intel) I found this in Apple Technical Note TN2071:

malloc.h
    Not supported, use stdlib.h

these files:
lexer.l
ast.h
ast.c
asmutil.c
lcc.cpp

do a #include <malloc.h> but also #include <stdlib.h> (except lcc.cpp, did a 
replace)
so if you delete the malloc line you should get past that error.

I got this error:
bison: option `--defines' doesn't allow an argument

I used FinkCommander to get bison 2.0-12, that made that go away.

Got this error from flex:

flex: can't open lex.yy.c

changed the makefile line 35 to:

    ${LEX} -o${LEX_SOURCE_OUT} $<

(removed the space between -o and the {LEX_SOURCE_OUT})

do a make clean and delete grammar.tab.* and lex.yy.c if they're still around

I can't get past this error now:

Compy:~/Projects/lcc craigdodge$ make
  C -> S  asmutil.s
gcc -Wall -Werror -fPIC -ggdb -m32 -S asmutil.c
bison -v -d -k -o grammar.tab.c --defines=grammar.tab.h grammar.y
flex -olex.yy.c lexer.l
  CC      lex.yy.o
gcc -Wall -Werror -fPIC -ggdb -c lex.yy.c
  CC [h]  grammar.tab.o
gcc -Wall -Werror -fPIC -ggdb -c grammar.tab.c
grammar.y: In function 'generate_ast':
grammar.y:268: error: 'yytname' undeclared (first use in this function)
grammar.y:268: error: (Each undeclared identifier is reported only once
grammar.y:268: error: for each function it appears in.)
make: *** [grammar.tab.o] Error 1

Original comment by craigvdo...@gmail.com on 24 Jan 2008 at 6:23

Attachments: