need help installing!!

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
pgarvey
Posts: 3
Joined: Tue Feb 24, 2009 9:08 am

need help installing!!

Post by pgarvey »

Im getting the following errors when I run 'make' on ubuntu.

posixSystem.cpp:(.text+0x396): warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
objs/yglue.o: In function `yyerror':
yglue.cpp:(.text+0x19): undefined reference to `yylineno'
yglue.cpp:(.text+0x44): undefined reference to `yylineno'
objs/yglue.o: In function `yg_ResetForNextFile':
yglue.cpp:(.text+0x75): undefined reference to `yylineno'
objs/yglue.o: In function `yg_Reset':
yglue.cpp:(.text+0x16f): undefined reference to `yylineno'
yglue.cpp:(.text+0x178): undefined reference to `yyrestart'
objs/yglue.o: In function `yg_functionType':
yglue.cpp:(.text+0x310): undefined reference to `yylineno'
yglue.cpp:(.text+0x332): undefined reference to `yylineno'
yglue.cpp:(.text+0x462): undefined reference to `yylineno'
yglue.cpp:(.text+0x487): undefined reference to `yylineno'
yglue.cpp:(.text+0x4c6): undefined reference to `yylineno'
objs/yglue.o:yglue.cpp:(.text+0x4e8): more undefined references to `yylineno' follow
objs/y.tab.o: In function `yyparse':
y.tab.c:(.text+0x409): undefined reference to `yylex'
collect2: ld returned 1 exit status
make: *** [cfdg] Error 1

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

The Makefile is not running flex to make the lexer. Try typing

Code: Select all

make objs/lex.yy.o
and see what results you get.

pgarvey
Posts: 3
Joined: Tue Feb 24, 2009 9:08 am

Post by pgarvey »

running that gives me;

make: `objs/lex.yy.o' is up to date.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

That's strange. The yyline, yyrestart, and yylex symbols should be defined in lex.yy.o. What happens when you type

Code: Select all

nm objs/lex.yy.o

pgarvey
Posts: 3
Joined: Tue Feb 24, 2009 9:08 am

Post by pgarvey »

absolutely nothing

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

This is what I get:

Code: Select all

john@ciliasun   ~/Projects/CF2.2
[1051] : nm objs/lex.yy.o
         U ___error
         U ___stderrp
         U ___stdinp
         U ___stdoutp
         U _exit
         U _fileno
         U _fprintf
         U _free
         U _fwrite$UNIX2003
         U _isatty
         U _malloc
         U _realloc
         U _strlen
         U _yg_BuildReal
         U _yg_BuildString
         U _yg_Input
000033a0 s _yy_accept
00002ee0 s _yy_base
00003af8 b _yy_buffer_stack
00003b08 b _yy_buffer_stack_max
00003af4 b _yy_buffer_stack_top
00003b04 b _yy_c_buf_p
00002680 s _yy_chk
000006e0 T _yy_create_buffer
000031c0 s _yy_def
00000380 T _yy_delete_buffer
00003b14 b _yy_did_buffer_switch_on_eof
00003560 s _yy_ec
00001cd4 D _yy_flex_debug
00000170 T _yy_flush_buffer
00003b0c b _yy_hold_char
00003b00 b _yy_init
00000410 t _yy_init_buffer
00003b1c b _yy_last_accepting_cpos
00003b18 b _yy_last_accepting_state
000030c0 s _yy_meta
00003b10 b _yy_n_chars
00001e20 s _yy_nxt
00001d00 s _yy_rule_can_match_eol
00000770 T _yy_scan_buffer
00000990 T _yy_scan_bytes
00000a40 T _yy_scan_string
00003afc b _yy_start
00001b80 T _yy_switch_to_buffer
00000140 T _yyalloc
00000160 T _yyfree
00000100 T _yyget_debug
00000020 T _yyget_in
00000060 T _yyget_leng
00000000 T _yyget_lineno
00000040 T _yyget_out
00000080 T _yyget_text
00001ce0 D _yyin
00000004 C _yyleng
00000b00 T _yylex
00000610 T _yylex_destroy
00001cd8 D _yylineno
         U _yylval
00001cdc D _yyout
00000540 T _yypop_buffer_state
00000200 T _yypush_buffer_state
00000150 T _yyrealloc
00001a30 T _yyrestart
00000120 T _yyset_debug
000000c0 T _yyset_in
000000a0 T _yyset_lineno
000000e0 T _yyset_out
00000004 C _yytext

john@ciliasun   ~/Projects/CF2.2
[1052] : 
Try deleting objs/lex.yy.* and make objs/lex.yy.o again. The way the Makefile is written it seems to produce objs/lex.yy.o even if the flex operation fails.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

In the Makefile if you replace the line

Code: Select all

flex -t $^ > $@
with

Code: Select all

flex -o $@ $^
then flex failures will no longer be masked.

Post Reply