GNOME Bugzilla – Bug 558537
error: structure has no member named `label'
Last modified: 2009-01-13 18:22:06 UTC
Please describe the problem: When building nautilus nautilus-2.24.1 the build fails with the following error: error: structure has no member named `label' error: structure has no member named `view_as_label' Steps to reproduce: 1. fetch nautilus-2.24.1 from ftp 2. build with the following configure arguments: --enable-empty-view 3. run make Actual results: Build fails. Expected results: When --enable-empty-view is not passed as a configure argument, build succeeds. Does this happen every time? Yes. Other information: I think this is fallout from svn revision 14024 and/or 14328.
Confirmed in the last trunk: gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../cut-n-paste-code -pthread -DORBIT2=1 -D_REENTRANT -I/home/fleury/.rootdir/include/glib-2.0 -I/home/fleury/.rootdir/lib/glib-2.0/include -I/home/fleury/.rootdir/include/eel-2 -I/home/fleury/.rootdir/include/gtk-2.0 -I/home/fleury/.rootdir/include/gail-1.0 -I/home/fleury/.rootdir/lib/gtk-2.0/include -I/home/fleury/.rootdir/include/gnome-desktop-2.0 -I/home/fleury/.rootdir/include/gio-unix-2.0/ -I/usr/include/gconf/2 -I/usr/include/libxml2 -I/usr/include/orbit-2.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/startup-notification-1.0 -I/usr/include/unique-1.0 -I/home/fleury/.rootdir /include/glib-2.0 -I/home/fleury/.rootdir/lib/glib-2.0/include -I/usr/include/pango-1.0 -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Werror -Wstrict-aliasing=0 -Wno-pointer-sign -DNAUTILUS_DATADIR=\"/usr/local/share/nautilus\" -DDATADIR=\"/usr/local/share\" -DG_DISABLE_DEPRECATED -g -O2 -MT fm-empty-view.lo -MD -MP -MF .deps/fm-empty-view.Tpo -c fm-empty-view.c -fPIC -DPIC -o .libs/fm-empty-view.o cc1: warnings being treated as errors fm-empty-view.c: In function ‘fm_empty_view_class_init’: fm-empty-view.c:318: error: assignment from incompatible pointer type fm-empty-view.c: In function ‘fm_empty_view_create’: fm-empty-view.c:350: error: ‘slot’ redeclared as different kind of symbol fm-empty-view.c:348: error: previous definition of ‘slot’ was here fm-empty-view.c: At top level: fm-empty-view.c:391: error: initialization from incompatible pointer type fm-empty-view.c:392: error: initialization from incompatible pointer type fm-empty-view.c:394: error: excess elements in struct initializer fm-empty-view.c:394: error: (near initialization for ‘fm_empty_view’) fm-empty-view.c: In function ‘fm_empty_view_register’: fm-empty-view.c:399: error: ‘NautilusViewInfo’ has no member named ‘label’ fm-empty-view.c:399: error: ‘NautilusViewInfo’ has no member named ‘label’ fm-empty-view.c:400: error: ‘NautilusViewInfo’ has no member named ‘view_as_label’ fm-empty-view.c:400: error: ‘NautilusViewInfo’ has no member named ‘view_as_label’ fm-empty-view.c:401: error: ‘NautilusViewInfo’ has no member named ‘view_as_label_with_mnemonic’ fm-empty-view.c:401: error: ‘NautilusViewInfo’ has no member named ‘view_as_label_with_mnemonic’ make[4]: *** [fm-empty-view.lo] Error 1 make[4]: Leaving directory `/home/fleury/development/teaching/gnome-project/nautilus-test/src/file-manager' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/fleury/development/teaching/gnome-project/nautilus-test/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/fleury/development/teaching/gnome-project/nautilus-test/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/fleury/development/teaching/gnome-project/nautilus-test' make: *** [all] Error 2
Confirming.
Ok, This one was easy... In fact, the '--enable-empty-view' unveil a part of the code which is not used if the flag is not there. Unluckily, this 'not so commonly used' code was built a struct type from other part of the code and the fields of this struct did change a bit (mostly simple renaming of the fields). I attach a small patch fixing the build process (and hopefully fixing the code as well) to this report.
Created attachment 122415 [details] [review] Fixing the 'empty-view' code
that seems to be doing the trick. thanks.
You're welcome ! Hmmm, in my humble opinion, someone should apply this patch to the trunk and close this bug, no ??? :)
Nautilus developers prefer people to post patches to the mailing list[1] (see HACKING[2] file), besides attaching it to bugzilla, so it can be seen by more people, that may help you in get it committed. [1] http://mail.gnome.org/mailman/listinfo/nautilus-list [2] http://svn.gnome.org/viewvc/nautilus/trunk/HACKING?view=markup
2009-01-13 A. Walton <awalton@gnome.org> * src/file-manager/fm-empty-view.c (fm_empty_view_end_loading), (fm_empty_view_create), (fm_empty_view_register): Unbreak build when building with --enable-empty-view. Closes bug #558537. Patch by Emmanuel Fleury.