Rob Syme
2016-Apr-29 10:01 UTC
[Gluster-users] Gluster Compilation error: undefined reference to `yylex'
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 at 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. -r -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.gluster.org/pipermail/gluster-users/attachments/20160429/580fc57e/attachment.html>
Atin Mukherjee
2016-Apr-29 16:10 UTC
[Gluster-users] Gluster Compilation error: undefined reference to `yylex'
Have you run ./autogen.sh && ./configure prior to make? -Atin Sent from one plus one On 29-Apr-2016 9:38 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 at 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. > > -r > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://www.gluster.org/mailman/listinfo/gluster-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.gluster.org/pipermail/gluster-users/attachments/20160429/1c3c8bbd/attachment.html>
Kaushal M
2016-May-02 03:18 UTC
[Gluster-users] Gluster Compilation error: undefined reference to `yylex'
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 at 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
Kaleb S. KEITHLEY
2016-May-04 17:44 UTC
[Gluster-users] Gluster Compilation error: undefined reference to `yylex'
On 04/29/2016 06:01 AM, Rob Syme 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 at mail.opensolaris.org/msg00601.html)Take a look at .../libglusterfs/src/Makefile. You'll see that lex and yacc (flex and bison) are run with -p graphyy, meaning that the lexical analyzer and parser functions' names are graphyylex() and graphyyparse() ? both contained in libglusterfs.so. This is standard practice when building yacc-and-lex-based parsers into libraries; it allows an application to link with other libraries that might also contain their own yacc-and-lex-based parsers. I don't know what /foo/bar/lib/libfl.so is, or why it expects the lexical analyzer to be named yylex(), but that's the crux of your problem. You could try editing the .../glusterfsd/src/Makefile to remove --quiet options and run `make V=1` in the .../glusterfsd/src directory for more verbose output and that may provide better hints. All our linux, *BSD, and Mac boxes don't have a libfl.so and don't try to link with it. And perhaps if we knew what platform you're trying to build on we could give you a better answer. (But if it's OpenSolaris, well, you're probably pretty much on your own there.)> > 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. > > -r > > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://www.gluster.org/mailman/listinfo/gluster-users >-- Kaleb