fpaquet / gtksheet

A spreadsheet widget for Gtk+
http://fpaquet.github.io/gtksheet/
Other
27 stars 9 forks source link

build faiure - gcc 10 - multiple definition of `GtkSheetBorderBits' #35

Closed greyltc closed 2 years ago

greyltc commented 4 years ago

I'm building your latest tagged commit: https://github.com/fpaquet/gtksheet/commit/3d84430c1223b97edf2e1dff3767e2ab8ff585fb

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread -O2 -Wall -MT gtksheet.lo -MD -MP -MF .deps/gtksheet.Tpo -c gtksheet.c -o gtksheet.o >/dev/null 2>&1
mv -f .deps/gtksheet.Tpo .deps/gtksheet.Plo
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -O2 -Wall -version-info 4:5:3 -export-dynamic -rpath /usr/lib  -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0   -o libgtksheet-4.0.la  gtkdataentry.lo gtkdataformat.lo pango-markup.lo gtkdatatextview.lo gtksheet.lo gtksheetcolumn.lo gtksheet-marshal.lo gtksheettypebuiltins.lo  gtksheet-resources.lo  -lm 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/gtkdataentry.o .libs/gtkdataformat.o .libs/pango-markup.o .libs/gtkdatatextview.o .libs/gtksheet.o .libs/gtksheetcolumn.o .libs/gtksheet-marshal.o .libs/gtksheettypebuiltins.o .libs/gtksheet-resources.o   -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lm  -O2   -Wl,-soname -Wl,libgtksheet-4.0.so.1 -o .libs/libgtksheet-4.0.so.1.3.5
/usr/bin/ld: .libs/gtksheetcolumn.o:(.bss+0x0): multiple definition of `GtkSheetBorderBits'; .libs/gtksheet.o:(.bss+0x0): first defined here
/usr/bin/ld: .libs/gtksheettypebuiltins.o:(.bss+0x0): multiple definition of `GtkSheetBorderBits'; .libs/gtksheet.o:(.bss+0x0): first defined here

But my build fails with the above. Any ideas?

ivanbakel commented 3 years ago

This is to do with a change in GCC 10 - there's a PR to fix it #33.

fpaquet commented 3 years ago

Which branch are you compiling?

ivanbakel commented 3 years ago

For me, this was an issue on the gtk3 branch (which is the branch the PR is against).

fpaquet commented 3 years ago

Looks like you were using the most up-to-date branch. But i can't confirm this happening on CentOS6, CentOS7, RHEL8.

What operating system did you use?

ivanbakel commented 3 years ago

I use Arch. It looks like all the distros you listed have older versions of GCC. Prior to GCC 10, this wasn't an issue. I linked the GCC 10 release notes on my PR - if you look for the notes on -fno-common, you can see that the issue is a linker error exclusive to newer versions of GCC.

fpaquet commented 3 years ago

Thank you for clarification. Now I must check how to integrate gcc 10 in our build environment.

fpaquet commented 2 years ago

The proposed fix was incorporated into branch "gtk3_fixes" and will be published with GtkSheet v4.3.10

I have no possibility to test it, due to lack of gcc 10 in my build environment. Would be nice to get feedback.

Thanks for reporting.

greyltc commented 2 years ago

@fpaquet thanks for fixing this! I can confirm it works in Arch Linux (with gcc (GCC) 11.2.0) now. To get this to build while trying to test testing this, I had to apply some new fixes I'll attach here in a patch build_fix.patch.txt

fpaquet commented 2 years ago

Thank you for feedback.

Why did you remove the embedded stylesheet 'gtksheet.css' from meson.build compile_resources()?

fpaquet commented 2 years ago

I've incorporated your glade sheet editor fixes into branch gtk3_fixes, to be released soon.

Still curious, why you removed the embedded stylesheet 'gtksheet.css' from meson.build?

Thanks for reporting.

greyltc commented 2 years ago

Why did you remove the embedded stylesheet 'gtksheet.css' from meson.build compile_resources()?

I'm not so sure if I did the right thing there. I can't remember the exact error that was coming up with that one, but I read the docs here for gnome.compile_resources() and found the function call as it was didn't seem to adhere to the documentation, so I made the change and the build was then able to complete.