2

试图在代码块中编译一个简单的 gtkmm 应用程序,但只是得到有关 ustring.h 文件的错误

C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|861|error: ISO C++ forbids declaration of `wostringstream' with no type|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|861|error: expected `;' before "StreamType"|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|865|error: `StreamType' does not name a type|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|906|error: expected constructor, destructor, or type conversion before '&' token|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|906|error: expected `,' or `;' before '&' token|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|912|error: expected constructor, destructor, or type conversion before '&' token|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|912|error: expected `,' or `;' before '&' token|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h||In member function `void Glib::ustring::FormatStream::stream(const T&)':|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|1057|error: `stream_' undeclared (first use this function)|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|1057|error: (Each undeclared identifier is reported only once for each function it appears in.)|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h||In member function `void Glib::ustring::FormatStream::stream(const char*)':|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|1063|error: `stream_' undeclared (first use this function)|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h||In member function `void Glib::ustring::FormatStream::stream(char*)':|
C:\gtkmm\include\glibmm-2.4\glibmm\ustring.h|1069|error: `stream_' undeclared (first use this function)|
||=== Build finished: 11 errors, 0 warnings ===|

pkg-config --libs gtkmm-2.4使用我添加到链接器选项和编译器的构建选项pkg-config --cflags gtkmm-2.4-> 其他选项。

我使用的代码是一个简单的例子

#include <gtkmm.h>


int main(int argc, char *argv[])
{
  Glib::RefPtr<Gtk::Application> app =
    Gtk::Application::create(argc, argv,
      "org.gtkmm.examples.base");

  Gtk::ApplicationWindow window;

  return app->run(window);
}

任何帮助将不胜感激,我正在运行 win7 x64

4

1 回答 1

1

如果要使用Gtk::Applicationet al,至少需要使用gtkmm-3.4。应用程序是 gtk 3.x 类,直到 gtkmm-3.4 才正确包装。

于 2012-09-09T18:31:19.077 回答