msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.22k stars 1.19k forks source link

mingw-w64-x86_64-gtkmm3-3.24.3-* linking issue about Gtk::TextIter #8008

Closed giuspen closed 3 years ago

giuspen commented 3 years ago

last good is mingw-w64-x86_64-gtkmm3-3.24.2-1-any.pkg.tar.xz (I manually downgraded from http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gtkmm3-3.24.2-1-any.pkg.tar.xz) since the switch to 3.24.3 I have several linking issues such as:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: libcherrytree_shared.a(ct_actions_edit.cc.obj):ct_actions_edit.cc:(.text$_ZN4Glib7ustringC1IN3Gtk8TextIterEEET_S4_[_ZN4Glib7ustringC1IN3Gtk8TextIterEEET_S4_]+0x54): undefined reference toimpZN3GtkneERKNS8TextIterES2`

The issues disappear as soon as I downgrade:

pacman -U mingw-w64-x86_64-gtkmm3-3.24.2-1-any.pkg.tar.xz

Biswa96 commented 3 years ago

Do you have a program or sample code to test?

giuspen commented 3 years ago

I do: https://github.com/giuspen/cherrytree/blob/master/README.md#building-cherrytree-on-windows

giuspen commented 3 years ago

Thanks @Biswa96

Biswa96 commented 3 years ago

Interesting, I build the project in ArchLinux without any error, with the same version of gtkmm3 library. Also the overloaded operator is defined in treeiter.h header file. Why linking error? 🤔

jeremyd2019 commented 3 years ago

Probably another oversight in the change in how symbols are exported, like https://github.com/msys2/MINGW-packages/commit/f2b9f3f47fc68de84e748331200c6263d9640029

abidrahmank commented 3 years ago

I get this error while installing the package :

$ pacman -U mingw-w64-x86_64-gtkmm3-3.24.2-1-any.pkg.tar.xz

loading packages...
error: 'mingw-w64-x86_64-gtkmm3-3.24.2-1-any.pkg.tar.xz': could not find or read package

I am using Pacman v5.2.2 - libalpm v12.0.2

abidrahmank commented 3 years ago

Providing full link to pacman worked for downgrading.

pacman -U http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gtkmm3-3.24.2-1-any.pkg.tar.xz

Biswa96 commented 3 years ago

@abidrahmank To use -U option, you have to provide the package file path or a link from a mirror. See man pacman for further details.

sp1ritCS commented 3 years ago

Hi, we are currently facing the same issue with the windows build for NoteKit.

This affects not only native builds with msys2/mingw but also our Fedora mingw cross compiles. It works on Fedora 33 (mingw64-gtkmm30 3.24.2-3.fc33) but it's broken on f34 (3.24.4-1.fc34). Manually downgrading mingw64-gtkmm30 on f34 to the f33 works.)

giuspen commented 3 years ago

Would it be possible to upgrade gtkmm3 package to 3.24.5? I saw few commit comments that make me hope this issue is fixed.

sp1ritCS commented 3 years ago

I just built gtkmm 3.24.5 from source, it's fixed:

[...]
../mainwindow.cpp:531:41: warning: unused parameter 'any_event' [-Wunused-parameter]
  531 | bool CMainWindow::on_close(GdkEventAny* any_event)
      |                            ~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/clatexmath/common.h:31,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/clatexmath/latex.h:4,
                 from ../mainwindow.cpp:9:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/clatexmath/utils/utf.h: In function 'std::wstring tex::utf82wide(const char*)':
/usr/x86_64-w64-mingw32/sys-root/mingw/include/clatexmath/utils/utf.h:59:30: warning: 'codepoint' may be used uninitialized in this function [-Wmaybe-uninitialized]
   59 |       codepoint = (codepoint << 6) | (ch & 0x3f);
      |                   ~~~~~~~~~~~^~~~~
/usr/x86_64-w64-mingw32/sys-root/mingw/include/clatexmath/utils/utf.h:53:16: note: 'codepoint' was declared here
   53 |   unsigned int codepoint;
      |                ^~~~~~~~~
[7/7] Linking target notekit.exe
[root@2eb5c76ff5ed notekit]# cat /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/gtkmm-3.0.pc 
prefix=/usr/x86_64-w64-mingw32/sys-root/mingw
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
datarootdir=${prefix}/share
datadir=${datarootdir}
includedir=${prefix}/include

gmmprocm4dir=${libdir}/gtkmm-3.0/proc/m4

docdir=${datarootdir}/doc/gtkmm-3.0
doxytagfile=${docdir}/reference/gtkmm-3.0.tag
htmlrefdir=${docdir}/reference/html
htmlrefpub=http://library.gnome.org/devel/gtkmm/3.24/

Name: gtkmm
Description: C++ binding for the GTK+ toolkit
Version: 3.24.5
URL: http://www.gtkmm.org/
Requires: giomm-2.4 >= 2.54.0 gtk+-3.0 >= 3.24.0 cairomm-1.0 >= 1.12.0 pangomm-1.4 >= 1.12.0 gdk-pixbuf-2.0 >= 2.35.5 atkmm-1.6 >= 2.24.2 gdkmm-3.0
Libs: -L${libdir} -lgtkmm-3.0
Cflags: -I${includedir}/gtkmm-3.0 -I${libdir}/gtkmm-3.0/include
giuspen commented 3 years ago

I built and installed the package for gtkmm3 3.24.5 and subsequently built successfully cherrytree. I created a pull request, I hope it will be merged.

sp1ritCS commented 3 years ago

It's not only gtkmm with fixed dllexports, atkmm, pango and pangomm apparently too.

https://bodhi.fedoraproject.org/updates/FEDORA-2021-da7e20915b

Maybe add them to the PR?

giuspen commented 3 years ago

One thing at a time

Biswa96 commented 3 years ago

I have updated those in another pull request.

giuspen commented 3 years ago

Thanks @Biswa96