我正在尝试在 Windows 10 中运行 gtkmm 程序,即使我完全按照下面所附链接提供的步骤进行编译,我也会遇到错误。
我安装了 MSYS2,运行所有命令并使用 pacman 命令安装了所有必需的软件包(我遵循了这个)。
一个程序的例子:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
auto app =
Gtk::Application::create(argc, argv,
"org.gtkmm.examples.base");
Gtk::Window window;
window.set_default_size(200, 200);
return app->run(window);
}
使用命令行执行时的错误消息(在此处找到):
g++ simple.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`
我收到这些错误:
C:\Users\sofiane\Desktop>g++ simple.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`
g++: error: `pkg-config: No such file or directory
g++: error: gtkmm-3.0: No such file or directory
g++: error: unrecognized command line option '--cflags'
g++: error: unrecognized command line option '--libs`'