Re: [Flex-help] undefined reference to 'yylex'
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Michele B. <mic...@gm...> - 2014-04-10 12:58:49
|
2014-04-10 11:43 GMT+02:00 liugongquan123 <liu...@16...>: > /usr/local/lib/libfl.so:undefined reference to 'yylex' > collect2:ld returned 1 exit status > As I can see, yylex() is defined in /flex-2.5.39/yylex.c, and "/usr/local/lib/libfl.so " is > installed by flex "make install", why there are such errors,and how to resolve it? As far as I understand, yylex() is the function genereted by flex, so it is not provided by flex libraries themselves. If you write <yourfile>.flex, and run it through flex, it generates <yourfile>.c, which contains the function yylex(). You have to compile that program, and link it to the final package. Is it right? -- Michele |