GTK&x2B;3.0“;没有任何应用程序注册为处理此文件”;

GTK&x2B;3.0“;没有任何应用程序注册为处理此文件”;,gtk,gtk3,Gtk,Gtk3,我正试图在我的GTK应用程序中创建一个关于对话框。单击网站链接时出现以下错误: Could not show link No application is registered as handling this file 代码如下: GtkWidget *dialog = gtk_about_dialog_new(); // some come here gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), "http://stackov

我正试图在我的GTK应用程序中创建一个关于对话框。单击网站链接时出现以下错误:

Could not show link
No application is registered as handling this file
代码如下:

GtkWidget *dialog = gtk_about_dialog_new();
// some come here
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), "http://stackoverflow.com");
// some code here
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);

问题是没有默认的浏览器集,但如何在windows上设置它?

这是因为您没有默认的浏览器集。XDG规范有一些辅助工具来设置这样的内容。在linux发行版的xdg utils包中,可以找到xdg setting命令

blah@blah:~$ xdg-settings --list
Known properties:
  default-web-browser           Default web browser
blah@blah:~$ xdg-settings get default-web-browser
firefox.desktop

在GNOME中,您可以通过运行
GNOME控制中心
→ “详情”→ “默认应用程序”,然后设置浏览器。

这是因为您没有设置默认浏览器。是的,我自己发现了:)但是如何在windows上消除这个错误?你找到了答案吗?Windows中也有同样的问题。@duncan不,这么多年以后,我甚至不再使用C/Cpp:)