我已经争取了一个月坚实的build立一个/ /工作/ C / GTKMM – 3.0应用程序与Windows MinGW。 我终于设法让图书馆,MinGW和Codeblocks在Windows XP(VirtualBox)上相处。 但是,当我尝试构build时,出现以下错误。
这些是gtkmm-3.0和依赖关系的最新版本。 我通过MSYS2获得了他们,但由于原因尚不清楚,我无法在该环境中构build。 因此,按照build议,我将它们复制到MinGW /lib
和/include
目录,并确保pkg-config
可以find它们。 一切都很好(据说)。
这些问题显然不是源于我的代码。 我没有写或修改gtkmm。 然而,我不能让这些消失。
值得一提的是,我最后得到的错误是“无法findglib :: 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))
这种types的错误消息似乎与其他稳定的工作项目和库在Windows上构build,除了gtkmm。
我最好的猜测是,我忘记了一些编译器标志,设置,或在构build过程中的其他明显的明显步骤。 我会提醒读者,我在CodeBlocks(13.14)上,所以我没有自己写这个build命令。
请求的信息 mingw32-g++.exe --version
mingw32-g ++。exe(tdm-1)4.7.1
这是与CodeBlocks 13.14捆绑在一起的版本。
…
我会提醒大家, 我没有写任何gtkmm或其依赖的方面 ,这是所有这些错误的起源。 此外,这是一个完全稳定的版本,不是testing版或开发快照。 其次, 这个完全相同的代码在我的Linux 版本上使用完全相同的版本 。
这就是说,这里是来自请求位置的完整的代码行。
C:/dev/MinGW/include/glibmm-2.4/glibmm/object.h,第117行
virtual ~Object() noexcept; //It should only be deleted by the callback.
C:/dev/MinGW/include/pangomm-1.4/pangomm/font.h,第98行
virtual ~Font();
你的g ++版本对于这个代码来说太老了:4.7.x有一个半成熟的方式,在继承的成员函数之间调整显式和隐含的异常规范,就像在这个例子中, Glib::Object
的虚析构函数和Pango::Font
。
您需要升级至少GCC 4.8.1 – 这恰好是MinGW的最新稳定版本。 您可以从TDM获得GCC的最新Windows端口。 最新的是5.1
PS我有点怀疑你是否拥有真正同步的glibmm-2.4
和pangomm-1.4
。 我有我的Linux发行版(Ubuntu 15.04)正式的这些包的来源,和我询问的标本问题声明的行号是不同于你的,他们都没有一个noexcept
规范,这当然避免了障碍。