From 94a00e2594b7e49bd232f13ec8ec7a3ef7b81330 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 26 Feb 2015 10:53:05 +0800 Subject: [PATCH] translated --- ....h--No such file or directory' on Linux.md | 99 ------------------- ....h--No such file or directory' on Linux.md | 98 ++++++++++++++++++ 2 files changed, 98 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md create mode 100644 translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md diff --git a/sources/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md b/sources/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md deleted file mode 100644 index 0ee6b607c8..0000000000 --- a/sources/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md +++ /dev/null @@ -1,99 +0,0 @@ -Translating----geekpi - -Linux FAQs with Answers--How to fix “fatal error: lame/lame.h: No such file or directory” on Linux -================================================================================ -> **Question**: I am trying to compile video encoder software on Linux, but the compilation fails with a message saying "fatal error: lame/lame.h: No such file or directory." How can I fix this error? - -The following compilation error suggests that your Linux system does not have LAME library and its development files installed. - - fatal error: lame/lame.h: No such file or directory - -[LAME][1] (short for "LAME Ain't an MP3 Encoder") is a popular MP3 encoding codec licensed with LGPL. Many video encoding/ripping tools use or support LAME. Among them are [FFmpeg][2], VLC, [Audacity][3], K3b, RipperX, and many more. - -To fix the compilation error, you need to install LAME library and its development files, as shown in the following. - -### Install LAME Library and its Development Files on Debian, Ubuntu or Linux Mint ### - -Debian and its derivative systems offer LAME library in their base repositories, so it is easy to install LAME with apt-get. - - $ sudo apt-get install libmp3lame-dev - -### Install LAME Library and its Development Files on Fedora, CentOS/RHEL ### - -On Red Hat based distributions, the LAME encoder library is available via the RPM Fusion's free repository. Thus you first need to set up [RPM Fusion (free) repository][4] before proceeding. - -Once RPM Fusion is set up, install LAME development files as follows. - - $ sudo yum --enablerepo=rpmfusion-free-updates install lame-devel - -As of February, 2015, RPM Fusion repository is not yet available for CentOS/RHEL 7. So this method will not be applicable on CentOS/RHEL 7. In that case, you can install LAME library by building it from the source (which is described below). - -### Compile LAME Library from the Source on Debian, Ubuntu or Linux Mint ### - -If you want to install customized LAME library with different compilation options, you need to build it yourself. Here is how you can compile and install LAME library (along with its header files) on your Debian-based system. - - $ sudo apt-get install gcc git - $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz - $ tar -xzf lame-3.99.5.tar.gz - $ cd lame-3.99.5 - $ ./configure --enable-static --enable-shared - $ make - $ sudo make install - -Note that when you run configure in the above steps, you can enable or disable various options based on your needs. Run the following command to see all available compilation options. - - $ ./configure --help - -The shared/static LAME libraries are installed in /usr/local/lib by default. To make the shared library accessible to other applications, complete this last step: - -Open /etc/ld.so.conf with your favorite text editor, and append the following line. - - /usr/local/lib - -and then run the command below. This will add shared libraries in /usr/local/lib to the dynamic loader cache, thereby making shared LAME library accessible to other applications. - - $ sudo ldconfig - -### Compile LAME Library from the Source on Fedora or CentOS/RHEL ### - -If your distribution (e.g., CentOS 7) does not offer a pre-built LAME library package, or you want to customize LAME library in any way, you need to build it from the source yourself. Here is how to compile and install LAME library and its development files on a Red Hat based system. - - $ sudo yum install gcc git - $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz - $ tar -xzf lame-3.99.5.tar.gz - $ cd lame-3.99.5 - $ ./configure --enable-static --enable-shared - $ make - $ sudo make install - -Before running make, feel free to customize compilation options by running configure with appropriate options. You can check available options with: - - $ ./configure --help - -Finally, you need to complete the last step because the shared LAME library installed in /usr/local/lib may not be visible to other applications. - -Append the following line in /etc/ld.so.conf: - - /usr/local/lib - -and then run the command below. This will add shared libraries (including LAME) in /usr/local/lib to the dynamic loader cache, making them visible to other applications. - - $ sudo ldconfig - -![](https://farm8.staticflickr.com/7340/16534478445_abc97cb65a_c.jpg) - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/fatal-error-lame-no-such-file-or-directory.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://lame.sourceforge.net/ -[2]:http://ask.xmodulo.com/compile-ffmpeg-ubuntu-debian.html -[3]:http://xmodulo.com/how-to-cut-split-or-edit-mp3-file-on-linux.html -[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html diff --git a/translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md b/translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md new file mode 100644 index 0000000000..685e637072 --- /dev/null +++ b/translated/tech/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md @@ -0,0 +1,98 @@ +Linux 有问必答:如何在Linux中修复“fatal error: lame/lame.h: No such file or directory” +================================================================================ +> **提问**: 我尝试着在Linux中编译视频编码器,但是编译提示出错:“fatal error: lame/lame.h: No such file or directory”, 我该如何修复这个错误? + +下面的编译错误说明你的系统没有安装LAME库和它的开发文件。 + + fatal error: lame/lame.h: No such file or directory + +[LAME][1]("LAME Ain't an MP3 Encoder")是一个流行的LPGL授权的MP3编码器。许多视频编码工具使用或者支持LAME。这其中有[FFmpeg][2]、 VLC、 [Audacity][3]、 K3b、 RipperX等。 + +要修复这个编译错误,你需要安装LAME库和开发文件,按照下面的来。 + +### 在Debian、Ubuntu或者Linux Mint上安装LAME库和安装文件 ### + +Debian和它的衍生版在基础库中已经提供了LAME库,因此可以用apt-get直接安装。 + + $ sudo apt-get install libmp3lame-dev + +### 在Fedora、CentOS/RHEL上安装LAME库和安装文件 ### + +在基于RED HAT的版本中,LAME在RPM Fusion的免费仓库中就有,那么你需要先设置[RPM Fusion (免费)仓库][4]。 + +RPM Fusion设置完成后,如下安装LAME开发文件。 + + $ sudo yum --enablerepo=rpmfusion-free-updates install lame-devel + +在2015年1月,RPM Fusion仓库已经不可以在CentOS/RHEL 7中可用了。因此,这个方法不能用在CentOS/RHEL 7 中。这时你就要从源码安装LAME库了(下面会描述)。 + +### 在Debian、Ubuntu或者Linux Mint中从源码编译LAME库 ### + +如果你希望用不同的编译选项安装自定义的LAME库,你需要自己编译。下面是怎样在基于Debian的系统中编译和安装LAME库(和它的头文件)。 + + $ sudo apt-get install gcc git + $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz + $ tar -xzf lame-3.99.5.tar.gz + $ cd lame-3.99.5 + $ ./configure --enable-static --enable-shared + $ make + $ sudo make install + +注意当你运行上面的配置步骤时,你可以根据你的需求启用会禁止不同的选项。运行下面的命令查看不同的编译选项。 + + $ ./configure --help + +共享/静态LAME默认安装在 /usr/local/lib。要让共享库可以被其他程序使用,完成最后一步: + +用编辑器打开 /etc/ld.so.conf,加入下面这行。 + + /usr/local/lib + +接着运行下面的命令,这会将/usr/local/lib中的共享库添加到动态加载缓存中,因此LAME库就可以被其他程序调用了。 + + $ sudo ldconfig + +### 在Fedora或者CentOS/RHEL中从源码编译LAME库 ### + +如果你的发行版(比如 CentOS 7)没有提供预编译的LAME库,或者你想要自定义LAME库,你需要从源码自己编译。下面是在基于Red Hat的系统中编译安装LAME库的方法。 + + + $ sudo yum install gcc git + $ wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz + $ tar -xzf lame-3.99.5.tar.gz + $ cd lame-3.99.5 + $ ./configure --enable-static --enable-shared + $ make + $ sudo make install + +运行make之前,你可以在configure中带上合适的选项自定义编译选项。你可以用下面的命令检查可用的选项: + + $ ./configure --help + +最后你需要完成最后一步,因为安装在/usr/local/lib的LAME共享库可能在其他程序中不可用。 + +在/etc/ld.so.conf中添加下面这行: + + /usr/local/lib + +接着运行下面的命令。这会添加 /usr/local/lib中的共享库(包括LAME)到动态加载缓存中,让其他程序可以访问到。 + + $ sudo ldconfig + +![](https://farm8.staticflickr.com/7340/16534478445_abc97cb65a_c.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fatal-error-lame-no-such-file-or-directory.html + +作者:[Dan Nanni][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://lame.sourceforge.net/ +[2]:http://ask.xmodulo.com/compile-ffmpeg-ubuntu-debian.html +[3]:http://xmodulo.com/how-to-cut-split-or-edit-mp3-file-on-linux.html +[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html