AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1141474
Accepted
Alunduyn
Alunduyn
Asked: 2019-05-09 02:47:10 +0800 CST2019-05-09 02:47:10 +0800 CST 2019-05-09 02:47:10 +0800 CST

无法编译 surf,找不到 gcr-3.pc,找不到 glib.h

  • 772

我正在尝试从源代码编译冲浪浏览器,但收效甚微。看起来我想念 gcr-3.pc。

编辑:我在 Ubuntu 19.04

c99 `pkg-config --cflags x11` `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` -DVERSION=\"2.0\" -DWEBEXTDIR=\"/usr/lib/surf\"  -D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE -fPIC -O -c common.c
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc' to the PKG_CONFIG_PATH environment variable

echo $PKG_CONFIG_PATH 什么也不打印。我已经安装了 pkg-config ( pkg-config is already the newest version (0.29.1-0ubuntu2)),那么我应该在哪里获取它?在其他发行版论坛上阅读 pkg-config 表明它应该在 /usr/lib/pkgconfig 中,但我只有一个文件 ibus-table.pc

另外,surf.c:8:10: fatal error: glib.h: No such file or directory 但我确实有油嘴滑舌!

>> cd /usr/include/glib-2.0
>> ls -a
.   gio   glib.h         glib-unix.h  gobject
..  glib  glib-object.h  gmodule.h

我真的很生气,找不到任何列出编译 surf 的依赖项的文档,甚至 surf 的自述文件也只是说“你需要 GTK+ 和 Webkit/GTK+ 头文件”。我想我得到了他们,为什么没有任何工作?我什至还没有修改任何东西!

完整的输出(有很多关于类型的警告):

>> sudo make clean install
rm -f surf surf.o common.o
rm -f libsurf-webext.so libsurf-webext.o
surf build options:
CC            = c99
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gcr-3' found
CFLAGS        =   -DVERSION="2.0" -DWEBEXTDIR="/usr/lib/surf"  -D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE -fPIC -O
WEBEXTCFLAGS  = -fPIC -pthread -I/usr/include/webkitgtk-4.0 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/webkitgtk-4.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -O
LDFLAGS       = 
c99 -fPIC `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -O -c libsurf-webext.c
libsurf-webext.c: In function ‘msgsurf’:
libsurf-webext.c:48:42: warning: format ‘%c’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
  if ((ret = snprintf(msg, sizeof(msg), "%c%c%s",
                                         ~^
                                         %ld
                      2 + sln, p ? p->id : 0, s))
                      ~~~~~~~              
libsurf-webext.c:48:44: warning: format ‘%c’ expects argument of type ‘int’, but argument 5 has type ‘guint64’ {aka ‘long unsigned int’} [-Wformat=]
  if ((ret = snprintf(msg, sizeof(msg), "%c%c%s",
                                           ~^
                                           %ld
                      2 + sln, p ? p->id : 0, s))
                               ~~~~~~~~~~~~~ 
libsurf-webext.c: In function ‘readpipe’:
libsurf-webext.c:84:2: warning: ‘webkit_dom_document_get_default_view’ is deprecated [-Wdeprecated-declarations]
  if (!p || !(view = webkit_dom_document_get_default_view(
  ^~
In file included from /usr/include/webkitgtk-4.0/webkitdom/webkitdom.h:42,
                 from /usr/include/webkitgtk-4.0/webkit2/WebKitFrame.h:32,
                 from /usr/include/webkitgtk-4.0/webkit2/webkit-web-extension.h:33,
                 from libsurf-webext.c:7:
/usr/include/webkitgtk-4.0/webkitdom/WebKitDOMDocument.h:640:1: note: declared here
 webkit_dom_document_get_default_view(WebKitDOMDocument* self);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libsurf-webext.c:92:3: warning: ‘webkit_dom_dom_window_get_inner_width’ is deprecated [-Wdeprecated-declarations]
   ww = webkit_dom_dom_window_get_inner_width(view);
   ^~
In file included from /usr/include/webkitgtk-4.0/webkitdom/webkitdom.h:40,
                 from /usr/include/webkitgtk-4.0/webkit2/WebKitFrame.h:32,
                 from /usr/include/webkitgtk-4.0/webkit2/webkit-web-extension.h:33,
                 from libsurf-webext.c:7:
/usr/include/webkitgtk-4.0/webkitdom/WebKitDOMDOMWindow.h:371:1: note: declared here
 webkit_dom_dom_window_get_inner_width(WebKitDOMDOMWindow* self);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libsurf-webext.c:93:3: warning: ‘webkit_dom_dom_window_scroll_by’ is deprecated [-Wdeprecated-declarations]
   webkit_dom_dom_window_scroll_by(view,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkitdom/webkitdom.h:40,
                 from /usr/include/webkitgtk-4.0/webkit2/WebKitFrame.h:32,
                 from /usr/include/webkitgtk-4.0/webkit2/webkit-web-extension.h:33,
                 from libsurf-webext.c:7:
/usr/include/webkitgtk-4.0/webkitdom/WebKitDOMDOMWindow.h:191:1: note: declared here
 webkit_dom_dom_window_scroll_by(WebKitDOMDOMWindow* self, gdouble x, gdouble y);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libsurf-webext.c:99:3: warning: ‘webkit_dom_dom_window_get_inner_height’ is deprecated [-Wdeprecated-declarations]
   wh = webkit_dom_dom_window_get_inner_height(view);
   ^~
In file included from /usr/include/webkitgtk-4.0/webkitdom/webkitdom.h:40,
                 from /usr/include/webkitgtk-4.0/webkit2/WebKitFrame.h:32,
                 from /usr/include/webkitgtk-4.0/webkit2/webkit-web-extension.h:33,
                 from libsurf-webext.c:7:
/usr/include/webkitgtk-4.0/webkitdom/WebKitDOMDOMWindow.h:358:1: note: declared here
 webkit_dom_dom_window_get_inner_height(WebKitDOMDOMWindow* self);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libsurf-webext.c:100:3: warning: ‘webkit_dom_dom_window_scroll_by’ is deprecated [-Wdeprecated-declarations]
   webkit_dom_dom_window_scroll_by(view,
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/webkitgtk-4.0/webkitdom/webkitdom.h:40,
                 from /usr/include/webkitgtk-4.0/webkit2/WebKitFrame.h:32,
                 from /usr/include/webkitgtk-4.0/webkit2/webkit-web-extension.h:33,
                 from libsurf-webext.c:7:
/usr/include/webkitgtk-4.0/webkitdom/WebKitDOMDOMWindow.h:191:1: note: declared here
 webkit_dom_dom_window_scroll_by(WebKitDOMDOMWindow* self, gdouble x, gdouble y);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c99 `pkg-config --cflags x11` `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` -DVERSION=\"2.0\" -DWEBEXTDIR=\"/usr/lib/surf\"  -D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE -fPIC -O -c common.c
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gcr-3' found
c99 -shared -Wl,-soname,libsurf-webext.so  -o libsurf-webext.so \
    libsurf-webext.o common.o `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
c99 `pkg-config --cflags x11` `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` -DVERSION=\"2.0\" -DWEBEXTDIR=\"/usr/lib/surf\"  -D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE -fPIC -O -c surf.c
Package gcr-3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gcr-3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gcr-3' found
surf.c:8:10: fatal error: glib.h: No such file or directory
 #include <glib.h>
          ^~~~~~~~
compilation terminated.
make: *** [Makefile:24: surf.o] Error 1

我在制作之前手动安装了所有这些依赖项:

build-essential
pkg-config
libglib2.0-dev
libgcc-4.8-dev
libseed-gtk4-dev
libgtk-3-dev
webkit2gtk-4.0
gdb
gdb-debug
dmenu

感谢您阅读整篇文章!

compiling gcc make pkg-config
  • 1 1 个回答
  • 4473 Views

1 个回答

  • Voted
  1. Best Answer
    marko
    2019-05-09T03:09:50+08:002019-05-09T03:09:50+08:00

    在终端中,运行sudo apt update && sudo apt install libgcr-3-dev<-- 那是针对 Ubuntu 18.04 LTS的。你没有说你使用的是什么 Ubuntu 版本。

    • 3

相关问题

  • 我可以在不重新编译源代码的情况下重建包吗?

  • 如何在没有 sudo 权限的情况下构建应用程序?

  • 为 i7 处理器编译内核的最佳方法是什么?

  • 如何将具有依赖项的包上传到我的 PPA?

  • 如何让 .so 文件显示在包中?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve