GNOME Bugzilla – Bug 349589
compilation fails
Last modified: 2006-08-04 22:13:13 UTC
Please describe the problem: imap_ncsa_parse.o: In function `ncsa_error':/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:170: undefined reference to `ncsa_in' :/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:170: undefined reference to `ncsa_restart' imap_ncsa_parse.o: In function `ncsa_parse':/usr/share/bison/bison.simple:573: undefined reference to `ncsa_lex' imap_ncsa_parse.o: In function `load_ncsa':/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:178: undefined reference to `ncsa_in' :/home/avp/soft/build/graphics/gimp/gimp-2006-08-01/plug-ins/imagemap/imap_ncsa.y:181: undefined reference to `ncsa_in' I'm using flex_2.5.31, bison 2.1-0.2 and byacc 20050813-1 on Ubuntu Dapper. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
I don't know what could be wrong. I have flex 2.5.33 and bison 2.3 on Debian testing and it works fine for me. It looks like a parsing error occured, because the first error in your trace looks like it could not parse "FILE *" (from stdio) and the second one looks like it could not find the function prototype that is declared at the top of the file. It may be a problem with your bison installation, although I am not sure.
Raphaël, the thing is that GIMP 2.3.10 compiles in the same system just fine. So something went wrong after this release.
I don't see anything that has changed in the files in question. Maybe you did an ubuntu update in the meantime? Does the 2.3.10 tarball still compile or did you compile it before?
Michael, I compiled 2.3.10 this morning right before posting Comment #2.
Well there is definitely something fishy here. I touched the *.l and *.y files in plug-ins/imagemap/ to force the regeneration of the C sources. The result is the following: flex -Pncsa_ -i -t imap_ncsa.l > imap_ncsa_lex.c bison -y -d -p ncsa_ imap_ncsa.y conflicts: 1 shift/reduce mv -f y.tab.h imap_ncsa_parse.h if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I/local/head/include/gtk-2.0 -I/local/head/lib/gtk-2.0/include -I/local/head/include/atk-1.0 -I/local/head/include/cairo -I/local/head/include/pango-1.0 -I/local/head/include/glib-2.0 -I/local/head/lib/glib-2.0/include -I/local/head/include -I/local/head/include -DGIMP_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -g -O2 -Wall -MT imap_ncsa_lex.o -MD -MP -MF ".deps/imap_ncsa_lex.Tpo" -c -o imap_ncsa_lex.o imap_ncsa_lex.c; \ then mv -f ".deps/imap_ncsa_lex.Tpo" ".deps/imap_ncsa_lex.Po"; else rm -f ".deps/imap_ncsa_lex.Tpo"; exit 1; fi In file included from <stdout>:553: /usr/include/unistd.h:728: error: expected identifier or ‘(’ before numeric constant make[1]: *** [imap_ncsa_lex.o] Error 1 make[1]: Leaving directory `/local/head/src/gnome/gimp/plug-ins/imagemap' make: *** [all-recursive] Error 1 That can't be right ;) Setting milestone to 2.4 and raising priority.
Maurits, can you look at this please?
Created attachment 70198 [details] [review] do not declare a symbol called link - apply patch in plug-ins/imagemap/ The problem seems to be caused by the imap_ncsa.l declaring a symbol called "link". This is a bad idea because this #define conflicts with the prototype of the system call link(), which is declared in <unistd.h>. It looks like recent versions of flex (2.5.x, with x > 5?) are now including <unistd.h> before the symbol declarations and this causes the build to fail. The attached patch attempts to replace the "link" symbol by "imap_link" and should hopefully solve this problem. Alexandre, please test this patch and tell me if you can now build the plug-in successfully.
Sorry, wrong explanation: recent versions of flex are now including <unistd.h> after (not before) the symbol declarations. Anyway, please report if this patch solves the problem or not.
Raphaël, your patch solves the issue. Thanx a lot :)
2006-08-05 Raphaël Quinet <raphael@gimp.org> * plug-ins/imagemap/imap_ncsa.l: Do not declare a symbol "link" because this conflicts with the system call declared in <unistd.h>. Renamed that symbol "imap_link". Fixes bug #349589. * plug-ins/imagemap/imap_ncsa_lex.c: Updated by hand in order to avoid large changes introduced by more recent versions of flex.