[Gluster-users] Gluster Compilation error: undefined reference to `yylex'

Kaushal M kshlmster at gmail.com
Mon May 2 03:18:32 UTC 2016


On Fri, Apr 29, 2016 at 3:31 PM, Rob Syme <rob.syme at gmail.com> wrote:
> Hi all
>
> When compiling Gluster, make fails with:
> ...
> Making all in src
>   CC       glusterfsd-mgmt.o
>   CC       glusterfsd.o
>   CCLD     glusterfsd
> /foo/bar/lib/libfl.so: undefined reference to `yylex'
> collect2: error: ld returned 1 exit status
> Makefile:509: recipe for target 'glusterfsd' failed
> make[3]: *** [glusterfsd] Error 1
> Makefile:456: recipe for target 'all-recursive' failed
> make[2]: *** [all-recursive] Error 1
> Makefile:588: recipe for target 'all-recursive' failed
> make[1]: *** [all-recursive] Error 1
> Makefile:487: recipe for target 'all' failed
> make: *** [all] Error 2
>
> Even though the error is coming from flex, It seems that gluster should
> supply the yylex function by auto-generated code that is the result of
> calling lex on a '.l' file
> (https://www.mail-archive.com/tools-linking@mail.opensolaris.org/msg00601.html)
>
> I'm using: flex v2.6.0, bison v3.0.4, pkg-config v0.29, liburcu v0.9.2,
> python v2.7.0, gcc v4.9.3 on linux (full dependency graph here:
> http://i.imgur.com/xdn8trW.png). Any pointers are appreciated.

Newer versions of flex (I don't know from which version) ship a .so,
which automake tries to link with whatever it is building by adding a
'-lfl' linker flag.
This causes the build failure. To avoid this, pass an empty 'LEXLIB='
option to the configure script, as in
`./configure  <other-options> LEXLIB=`

This will allow the compilation and linking to happen properly.

>
> -r
>
> _______________________________________________
> Gluster-users mailing list
> Gluster-users at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-users


More information about the Gluster-users mailing list