Gtk-警告无法在 netbeans 上找到信号处理程序

发布于 2024-09-15 00:06:27 字数 489 浏览 4 评论 0原文

我正在使用 grade 和 gtk 编程在 c 上使用 netbeans 构建一个界面。我已经按照本教程设置了我的项目。我什至将 libgmodule2-0.so 和 libglib2-0.so 添加到 netbeans 的链接器选项中。当我运行时,我收到警告 Gtk-WARNING 找不到信号句柄。当我关闭主窗口时,什么也没有发生(这是我的信号应该被捕获的地方)

如果我像这样编译我的程序(不使用netbeans)

gcc -o tut main.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0) 

它工作正常。当我关闭主窗口时它会关闭。

我喜欢使用 IDE,因为我可以获得所有功能(特别是调试)。对于这个问题有什么建议吗?

I'm building an interface using glade and gtk programming on c using netbeans. I've set up my project following this tutorial. I even added libgmodule2-0.so and libglib2-0.so to the linker options of netbeans. When I run i get the warning Gtk-WARNING Could not find signal handle. When I close the mainwindow nothing happens (this is where my signal should be caught)

If I compile my program like this (not using netbeans)

gcc -o tut main.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0) 

it works fine. When I close the mainwindow it closes.

I like using IDEs because all the features I get (specially debugging). Any suggestion for this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江城子 2024-09-22 00:06:27

我认为将 libgmodule2-0.solibglib2-0.so 添加到链接器选项是不够的。在终端中运行命令 pkg-config --cflags gtk+-2.0 gmodule-2.0 并查看其内容。将使用 -I 列出的任何目录添加到 NetBeans 项目的包含目录中,并将任何其他标志添加到 C 编译器选项中。

然后在终端中运行 pkg-config --libs gtk+-2.0 gmodule-2.0 并将其中列出的所有内容添加到链接器选项中。

I think that adding libgmodule2-0.so and libglib2-0.so to the linker options is not enough. Run the command pkg-config --cflags gtk+-2.0 gmodule-2.0 in your terminal and see what it says. Add any directories listed with -I to the include directories of your NetBeans project, and add any other flags to the C compiler options.

Then run pkg-config --libs gtk+-2.0 gmodule-2.0 in your terminal and add anything listed there to the linker options.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文