cs143 icon indicating copy to clipboard operation
cs143 copied to clipboard

undefined reference to `yylex'

Open colinaaa opened this issue 5 years ago • 1 comments

This problem is caused by c++ library virus c library. See here.

The solution is quite simple. Just link lexer with the static lc library.

Edit the Makefile where lexer is built:

LDFLAGS= -static

lexer: ${OBJS}
        ${CC} ${LDFLAGS} ${CFLAGS} ${OBJS} ${LIB} -o lexer

colinaaa avatar Jun 26 '20 07:06 colinaaa

This problem is caused by c++ library virus c library. See here.

The solution is quite simple. Just link lexer with the static lc library.

Edit the Makefile where lexer is built:

LDFLAGS= -static

lexer: ${OBJS}
        ${CC} ${LDFLAGS} ${CFLAGS} ${OBJS} ${LIB} -o lexer

thx! it works for me

younghojan avatar Aug 27 '23 08:08 younghojan