我正在关注GTK教程并且已经安装了所有依赖项,并且一切正常,但是当我运行我的代码时出现此错误:
(process:34571): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
(main:34571): Gtk-WARNING **: cannot open display:
我的main.cpp是:
#include <iostream>
#include <gtk/gtk.h>
int main (int argc, char *argv[])
{
std::cout << "hello GTK!!" << std::endl;
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
gtk_main();
return 0;
}
我该如何解决这个问题?