gpt4 book ai didi

c++ - 虚拟 noexcept(true) 错误 : MinGW and gtkmm

转载 作者:可可西里 更新时间:2023-11-01 11:49:49 25 4
gpt4 key购买 nike

为了使用 MinGW 在 Windows 上构建//working//C++/gtkmm-3.0 应用程序,我已经奋斗了一个月。我终于设法让库、MinGW 和 Codeblocks 在 Windows XP (VirtualBox) 上运行。但是,当我尝试构建时,出现以下错误。

这些是 gtkmm-3.0 和依赖项的最新版本。我通过 MSYS2 获得了它们,但由于未知原因我无法在该环境中构建。因此,按照通常的建议,我将它们复制到 MinGW /lib/include 目录,并确保 pkg-config 可以找到它们.一切都很好(据称)。

这些问题显然不是我的代码引起的。我没有编写或修改 gtkmm。然而,我无法让这些消失。

值得一提的是,我最近收到与“无法找到 glib::ustring::ustring”相关的错误,它决定停止提示,而是突然给我这些。如果之前的消息再次出现,我会在此处发布。

我开始认为根本不值得在 Windows 上发布此软件。

注意: 我得到了 50 多个这样的文件,它们都在 gtkmm-3.0 及其依赖库中,都来自 main 的第 1 行或第 2 行,并且都具有完全相同的细节。出于对空间的兴趣,我只会展示一些。

-------------- Build: Debug in infiltrator (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -std=c++11 -Wall -mms-bitfields -pthread -IC:/dev/MinGW/include/glibmm-2.4 -IC:/dev/MinGW/lib/glibmm-2.4/include -IC:/dev/MinGW/include/sigc++-2.0 -IC:/dev/MinGW/lib/sigc++-2.0/include -IC:/dev/MinGW/include/glib-2.0 -IC:/dev/MinGW/lib/glib-2.0/include -IC:/dev/MinGW/include/gtkmm-3.0 -IC:/dev/MinGW/lib/gtkmm-3.0/include -IC:/dev/MinGW/include/atkmm-1.6 -IC:/dev/MinGW/include/giomm-2.4 -IC:/dev/MinGW/lib/giomm-2.4/include -IC:/dev/MinGW/include/pangomm-1.4 -IC:/dev/MinGW/lib/pangomm-1.4/include -IC:/dev/MinGW/include/gtk-3.0 -IC:/dev/MinGW/include/cairomm-1.0 -IC:/dev/MinGW/lib/cairomm-1.0/include -IC:/dev/MinGW/include/gdk-pixbuf-2.0 -IC:/dev/MinGW/include/gdkmm-3.0 -IC:/dev/MinGW/lib/gdkmm-3.0/include -IC:/dev/MinGW/include/atk-1.0 -IC:/dev/MinGW/include/pango-1.0 -IC:/dev/MinGW/include/cairo -IC:/dev/MinGW/include/pixman-1 -IC:/dev/MinGW/include -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -IC:/dev/MinGW/include/freetype2 -IC:/dev/MinGW/include/libpng16 -IC:/dev/MinGW/include/harfbuzz -Wl,-luuid -LC:/dev/MinGW/lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -lwinmm -lz -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -lintl -std=c++11 -Wall -g -mms-bitfields -pthread -IC:/dev/MinGW/include/glibmm-2.4 -IC:/dev/MinGW/lib/glibmm-2.4/include -IC:/dev/MinGW/include/sigc++-2.0 -IC:/dev/MinGW/lib/sigc++-2.0/include -IC:/dev/MinGW/include/glib-2.0 -IC:/dev/MinGW/lib/glib-2.0/include -IC:/dev/MinGW/include/gtkmm-3.0 -IC:/dev/MinGW/lib/gtkmm-3.0/include -IC:/dev/MinGW/include/atkmm-1.6 -IC:/dev/MinGW/include/giomm-2.4 -IC:/dev/MinGW/lib/giomm-2.4/include -IC:/dev/MinGW/include/pangomm-1.4 -IC:/dev/MinGW/lib/pangomm-1.4/include -IC:/dev/MinGW/include/gtk-3.0 -IC:/dev/MinGW/include/cairomm-1.0 -IC:/dev/MinGW/lib/cairomm-1.0/include -IC:/dev/MinGW/include/gdk-pixbuf-2.0 -IC:/dev/MinGW/include/gdkmm-3.0 -IC:/dev/MinGW/lib/gdkmm-3.0/include -IC:/dev/MinGW/include/atk-1.0 -IC:/dev/MinGW/include/pango-1.0 -IC:/dev/MinGW/include/cairo -IC:/dev/MinGW/include/pixman-1 -IC:/dev/MinGW/include -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -IC:/dev/MinGW/include/freetype2 -IC:/dev/MinGW/include/libpng16 -IC:/dev/MinGW/include/harfbuzz -Wl,-luuid -LC:/dev/MinGW/lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -lwinmm -lz -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -lintl -std=c++11 -mms-bitfields -pthread -IC:/dev/MinGW/include/glibmm-2.4 -IC:/dev/MinGW/lib/glibmm-2.4/include -IC:/dev/MinGW/include/sigc++-2.0 -IC:/dev/MinGW/lib/sigc++-2.0/include -IC:/dev/MinGW/include/glib-2.0 -IC:/dev/MinGW/lib/glib-2.0/include -IC:/dev/MinGW/include/gtkmm-3.0 -IC:/dev/MinGW/lib/gtkmm-3.0/include -IC:/dev/MinGW/include/atkmm-1.6 -IC:/dev/MinGW/include/giomm-2.4 -IC:/dev/MinGW/lib/giomm-2.4/include -IC:/dev/MinGW/include/pangomm-1.4 -IC:/dev/MinGW/lib/pangomm-1.4/include -IC:/dev/MinGW/include/gtk-3.0 -IC:/dev/MinGW/include/cairomm-1.0 -IC:/dev/MinGW/lib/cairomm-1.0/include -IC:/dev/MinGW/include/gdk-pixbuf-2.0 -IC:/dev/MinGW/include/gdkmm-3.0 -IC:/dev/MinGW/lib/gdkmm-3.0/include -IC:/dev/MinGW/include/atk-1.0 -IC:/dev/MinGW/include/pango-1.0 -IC:/dev/MinGW/include/cairo -IC:/dev/MinGW/include/pixman-1 -IC:/dev/MinGW/include -I/mingw32/include/freetype2 -I/mingw32/include/libpng16 -I/mingw32/include/harfbuzz -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -IC:/dev/MinGW/include/freetype2 -IC:/dev/MinGW/include/libpng16 -IC:/dev/MinGW/include/harfbuzz -Iinclude -IC:\dev\MinGW\include -c "C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp" -o obj\Debug\main.o
In file included from C:/dev/MinGW/include/pangomm-1.4/pangomm/fontset.h:33:0,
from C:/dev/MinGW/include/pangomm-1.4/pangomm/context.h:37,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:32,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/pangomm-1.4/pangomm/font.h:98:11: error: looser throw specifier for 'virtual Pango::Font::~Font()'
In file included from C:/dev/MinGW/include/glibmm-2.4/glibmm/binding.h:23:0,
from C:/dev/MinGW/include/glibmm-2.4/glibmm.h:96,
from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:1:
C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h:117:11: error: overriding 'virtual Glib::Object::~Object() noexcept (true)'
In file included from C:/dev/MinGW/include/pangomm-1.4/pangomm/context.h:37:0,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:32,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/pangomm-1.4/pangomm/fontset.h:81:11: error: looser throw specifier for 'virtual Pango::Fontset::~Fontset()'
In file included from C:/dev/MinGW/include/glibmm-2.4/glibmm/binding.h:23:0,
from C:/dev/MinGW/include/glibmm-2.4/glibmm.h:96,
from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:1:
C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h:117:11: error: overriding 'virtual Glib::Object::~Object() noexcept (true)'
In file included from C:/dev/MinGW/include/pangomm-1.4/pangomm/fontfamily.h:34:0,
from C:/dev/MinGW/include/pangomm-1.4/pangomm/fontmap.h:36,
from C:/dev/MinGW/include/pangomm-1.4/pangomm/context.h:38,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:32,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/pangomm-1.4/pangomm/fontface.h:81:11: error: looser throw specifier for 'virtual Pango::FontFace::~FontFace()'
In file included from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/widget.h:41:0,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/actiongroup.h:29,
from C:/dev/MinGW/include/gtkmm-3.0/gtkmm/application.h:32,
from C:\Documents and Settings\Jason\Desktop\infiltrator\main.cpp:2:
C:/dev/MinGW/include/gtkmm-3.0/gtkmm/buildable.h:107:11: error: looser throw specifier for 'virtual Gtk::Buildable::~Buildable()'
Process terminated with status 1 (0 minute(s), 6 second(s))
50 error(s), 0 warning(s) (0 minute(s), 6 second(s))

除了 gtkmm 之外,这种类型的错误消息似乎会在 Windows 上构建的其他稳定、工作的项目和库中弹出。

我最好的猜测 是我忘记了一些编译器标志、设置或构建过程中其他非常明显的步骤。我会赶紧提醒读者,我在 CodeBlocks(13.14)上,所以我没有自己写那个构建命令。


要求的信息mingw32-g++.exe --version

mingw32-g++.exe (tdm-1) 4.7.1

这是与 CodeBlocks 13.14 捆绑在一起的版本。

...

我会赶紧提醒大家,我没有编写 gtkmm 或其依赖项的任何方面,这是所有这些错误的源头。此外,这是一个完全稳定的版本,而不是测试版或开发快照。其次,在我的 Linux 构建中,此完全相同的代码使用完全相同版本的库

也就是说,这里是请求位置的完整代码行。

C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h,第 117 行

virtual ~Object() noexcept;//它应该只被回调删除。

C:/dev/MinGW/include/pangomm-1.4/pangomm/font.h,第 98 行

虚拟 ~Font();

最佳答案

你的 g++ 版本对于这段代码来说太旧了:4.7.x 有一个半生不熟的方式与显式和隐式异常规范的协调在继承的成员函数之间,在本例中是在虚拟函数之间Glib::ObjectPango::Font 的析构函数。

您至少需要升级到 GCC 4.8.1 - 这恰好是MinGW 的最新稳定版本。你可以得到最新的GCC 的 Windows 端口来自 TDM .最新的有5.1

附言我有点怀疑你是否有glibmm-2.4pangomm-1.4 的构建是真正同步的。我有根据我的 Linux 发行版(Ubuntu 15.04),这些软件包的来源都是官方的,而且我查询的样本问题声明的行号与你的不同,而且它们都没有 noexcept 规范,当然避免障碍。

关于c++ - 虚拟 noexcept(true) 错误 : MinGW and gtkmm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32854765/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com