webkit building error:configure: error: Compiler GCC >= 4.7 or Clang >= 3.0 is required for C compil

I tried to install the webkit applicaion from sources using this manual:

https://help.ubuntu.com/community/WebKit

When I type:

./autogen.sh --prefix=/usr

the following error occurs:

checking for _FILE_OFFSET_BITS value needed for large files... 64
configure: error: Compiler GCC >= 4.7 or Clang >= 3.0 is required for C++ compilation

When I type:

gcc --version

It responds:

gcc (Ubuntu/Linaro 4.7.2-11precise2) 4.7.2

Hence the error does not concern gcc version. Why the execution fails?

Edited: Previous problem is solved by updating g++ to 4.7. But the following error occurs further:

checking for GAIL... no
configure: error: Package requirements (gail-3.0 >= 3.0) were not met:

No package 'gail-3.0' found 

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GAIL_CFLAGS
and GAIL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I have apt-get install gail-3.0, but the error remains.

Edited:Also did:

apt-get install gail-3.0-dev
apt-get build-dep webkit

But further missing packages revealed: error: Package requirements (libsoup-2.4 >= 2.40.0) were not met:

Requested 'libsoup-2.4 >= 2.40.0' but version of libsoup is 2.38.1

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBSOUP_CFLAGS
and LIBSOUP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
share improve this question
 
My guess is your G++ is older than your gcc –  hbdgaf Mar 17 at 22:40
 
3 
apt-get install gail-3.0-dev. Why don't you just apt-get build-dep whatever package contains webkit instead of fighting with this? –  hbdgaf Mar 18 at 5:27
1 
Agreed with @AbrahamVanHelpsing. Please read through the help document you linked to, it gives you a list of what to do, including what you need to install. –  Thomas W. Mar 18 at 6:20
2 
show 8 more comments

The PPA mentioned in the question is greatly outdated for 12.04 hence you have to disable it and find another instructions on building webkit from source. Additionally, someone has to edit the wiki.

Looks like webkit is now in libwebkitgtk-3.0-0. Try these:

sudo apt-get build-dep libwebkitgtk-3.0-0
apt-get source libwebkitgtk-3.0-0
cd webkit-*
dpkg-buildpackage

I'll edit the wiki if it works.

<think>嗯,用户遇到了编译FreeSWITCH时出现的依赖项缺失问题,具体是缺少spandsp3开发包。从报错信息和引用内容看,这显然是个典型编译依赖问题,用户应该是在尝试构建FreeSWITCH时被中断。用户可能是个开发者或者运维人员,正在搭建VoIP相关系统。ta直接粘贴了报错信息,说明已经具备基础技术认知,但卡在依赖解决环节。深层需求应该是想快速搭建环境而非研究底层原理,所以需要最直接的解决方案。这个报错其实涉及两个层面:软件包安装和环境检测。spandsp作为处理传真和语音信号的库,在编译时被检测到版本过低或缺失开发文件。解决关键在于同时安装运行时库和开发头文件。首先考虑主流Linux发行版的差异:Debian系和RPM系的包名格式完全不同。引用中提到的"spandsp3develpackage"其实是泛指,具体包名需对应操作系统。对于CentOS可能需要同时安装主包和devel包,而Ubuntu则是合并的libspandsp-dev。更棘手的是源码编译安装场景。当用户需要特定版本或发行版未提供时,必须解决其依赖链:libtiff和libjpeg。注意到用户引用[3]提到sofia-sip也可能报错,说明这可能是系统性缺失依赖,需要提醒用户检查所有前置条件。考虑到用户当前情绪应该比较焦急,步骤必须明确无歧义。给出命令时特意加上sudo前缀,避免新手权限问题。环境变量设置特别标注"临时生效",防止永久修改导致系统异常。最后用分段式解决方案覆盖不同场景,从最简单的包管理安装到最复杂的源码编译,用户可以根据实际情况选择路径。最后用加粗强调"必须安装开发包"这个关键点——因为很多人会忘记-devel/-dev包才是解决configure报错的核心。测试命令特意选择最简单的pkg-config方案,避免给用户增加额外负担。</think> 好的,这个问题是编译 FreeSWITCH(或类似软件)时遇到的常见错误,提示找不到满足版本要求(>=3.0)的 `spandsp` 库的开发文件。核心解决思路是 **在你的操作系统上正确安装 `spandsp3` 的开发包**。以下是详细解决方案: **核心解决方案:安装 `spandsp` 开发包** 1. **确定你的 Linux 发行版:** * 不同的发行版使用的包管理系统和包名称略有不同。 2. **使用包管理器安装:** * **基于 Debian/Ubuntu 的系统:** ```bash sudo apt update sudo apt install libspandsp-dev ``` * `libspandsp-dev` 是包含开发头文件(`*.h`)和库文件(`*.so`)的开发包。安装完成后,通常不需要手动设置环境变量,`pkg-config` 信息会自动配置好[^1][^2][^3][^4]。 * **基于 RHEL/CentOS/Fedora 的系统:** ```bash # RHEL/CentOS 7/8 (可能需要启用 EPEL 仓库) sudo yum install epel-release # 如果未启用 sudo yum install spandsp-devel # 或者 sudo dnf install spandsp-devel # CentOS 8 / Fedora ``` * 同样,`spandsp-devel` 包含了编译所需的开发文件。 **安装后验证** 安装完成后,最简单的方法是重新运行 `./configure`。如果安装成功,关于 `spandsp` 的检查应该能通过。 你也可以尝试手动检查 `pkg-config`(这是 `configure` 脚本检测库的主要方式): ```bash pkg-config --modversion spandsp ``` 如果正确安装,这条命令应该会输出安装的 `spandsp` 版本号(例如 `3.0.0` 或更高)[^1][^4]。 **其他重要情况和补充方案** 1. **确保安装了运行时库(如果单独存在):** * 在 Debian/Ubuntu 上,`libspandsp-dev` 通常会自动依赖运行时库 `libspandsp2` 或 `libspandsp3`。但在某些 RPM 系统上,可能需要分开安装: ```bash sudo yum/dnf install spandsp # 安装运行时库(通常会自动安装或作为依赖被安装) sudo yum/dnf install spandsp-devel # 安装开发库 ``` * **重点:你需要同时有运行库(`.so`)和开发包(`.h`, `.pc` 等)才能使编译成功[^3][^4]。使用 `devel` 包是确保两者的标准方法。** 2. **检查 `PKG_CONFIG_PATH`(较少见,但需排除):** * 如果你将 `spandsp` 安装到了非标准路径(例如 `/usr/local`),可能需要告诉 `pkg-config` 去哪里找它的 `.pc` 文件: ```bash export PKG_CONFIG_PATH=/your/custom/install/lib/pkgconfig:$PKG_CONFIG_PATH ``` * 然后重新运行 `./configure`。**绝大多数情况下,使用系统的包管理器安装后不需要这一步。**[^4] 3. **从源代码编译安装 spandsp(最后手段):** * 如果你的发行版仓库没有提供 >=3.0 的 `spandsp` 包,或者你需要一个非常新的版本,可以考虑从源代码编译安装: ```bash # 1. 下载源码 (前往 https://github.com/freeswitch/spandsp 获取最新版或 release) git clone https://github.com/freeswitch/spandsp # 或下载特定版本的 tar 包 # 2. 进入源码目录 cd spandsp # 3. 通常使用 autotools ./bootstrap.sh # 如果目录下有此脚本,可能需要先运行 ./configure --prefix=/usr/local # 配置,推荐安装到 /usr/local make sudo make install # 安装库和可执行文件 sudo ldconfig # 更新运行时链接器缓存 # 4. 确保pkg-config能找到它 (可能需要设置 PKG_CONFIG_PATH 如上述第2点) ``` * **注意:** 从源码编译可能还需要你先安装 `libtiff` 和 `libjpeg` 等图片编解码库的开发包[^4]。 * **谨慎使用:** 优先使用发行版官方包是最稳妥、最易于维护的方法。源安装可能会带来与其他包的依赖冲突。 **总结步骤(推荐):** 1. **识别你的发行版。** 2. **使用对应的包管理器安装 `spandsp3` 的开发包:** * **Ubuntu/Debian:** `sudo apt install libspandsp-dev` * **RHEL/CentOS:** `sudo yum install spandsp-devel` (确保 EPEL 仓库已启用) * **Fedora:** `sudo dnf install spandsp-devel` 3. **(可选但推荐)** 运行 `pkg-config --modversion spandsp` 确认版本 >=3.04. 重新运行 FreeSWITCH (或其他软件) 的 `./configure` 脚本。错误应该会消失。 **确保安装的是 `-dev` 或 `-devel` 包!** 这是解决 `configure: error: no usable spandsp` 这个特定错误的 **关键**[^1][^2][^3][^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值