gpt4 book ai didi

c - 如何在 Ubuntu 上安装 gtk 开发依赖?

转载 作者:太空狗 更新时间:2023-10-29 16:21:42 39 4
gpt4 key购买 nike

我有来自 GTK tutorial 的代码在 base.c 中。

我在 Ubuntu 上工作,当我使用

编译时
$ gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0` 

我收到以下错误

Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
base.c:1:20: fatal error: gtk/gtk.h: No such file or directory compilation terminated.

linux 新手,有人可以帮我设置环境,以便我可以成功编译/运行程序吗?

最佳答案

$ sudo apt-get install libgtk2.0-dev

一般来说,要基于libfoo 构建东西,您需要libfoo-dev

此外,要安装构建包所需的任何东西,比如 gedit,您可以运行:

$ sudo apt-get build-dep gedit

正在搜索 http://packages.ubuntu.com/或 Synaptic 可以提供帮助。

关于c - 如何在 Ubuntu 上安装 gtk 开发依赖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15390181/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com