0

我正在尝试安装taglib-ruby但不断收到相同的错误:

xyz@ubuntu:~$ sudo gem install taglib-ruby
Building native extensions.  This could take a while...
ERROR:  Error installing taglib-ruby:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lstdc++... no
You must have libstdc++ installed.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/bin/ruby1.9.1
    --with-tag-dir
    --without-tag-dir
    --with-tag-include
    --without-tag-include=${tag-dir}/include
    --with-tag-lib
    --without-tag-lib=${tag-dir}/lib
    --with-stdc++lib
    --without-stdc++lib


Gem files will remain installed in /var/lib/gems/1.9.1/gems/taglib-ruby-0.6.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/taglib-ruby-0.6.0/ext/taglib_base/gem_make.out

mkmf.log 说明如下:

have_library: checking for main() in -lstdc++... -------------------- no

"gcc -o conftest -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I/usr/local/include -I/opt/local/include -I/sw/include  -D_FILE_OFFSET_BITS=64  -fno-strict-aliasing -g -g -O2 -fPIC conftest.c  -L. -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L/sw/lib -L.  -rdynamic -Wl,-export-dynamic     -lruby-1.9.1  -lpthread -lrt -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

"gcc -o conftest -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I/usr/local/include -I/opt/local/include -I/sw/include  -D_FILE_OFFSET_BITS=64  -fno-strict-aliasing -g -g -O2 -fPIC conftest.c  -L. -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L/sw/lib -L.  -rdynamic -Wl,-export-dynamic     -lruby-1.9.1 -lstdc++  -lpthread -lrt -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main() {return 0;}
5: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */

"gcc -o conftest -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I/usr/local/include -I/opt/local/include -I/sw/include  -D_FILE_OFFSET_BITS=64  -fno-strict-aliasing -g -g -O2 -fPIC conftest.c  -L. -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L/sw/lib -L.  -rdynamic -Wl,-export-dynamic     -lruby-1.9.1 -lstdc++  -lpthread -lrt -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: int main() {return 0;}
5: int t() { main(); return 0; }
/* end */

--------------------

我按照自述文件中的说明进行安装libtag1-dev并仔细检查是否安装了 libstdc++(如果我错过了文件,我什至查看了 Ubuntu 软件中心)。我发现的唯一类似问题是这个,但我已经尝试明确定义opt-dirandopt-include也无济于事。

我不得不承认我对这个主题甚至 Ubuntu 都不是很熟悉,所以我很可能只是忽略或完全错过了有关错误消息的一些明显内容。

4

1 回答 1

0

Debian/Ubuntu:sudo apt-get install libtag1-dev

Fedora/RHEL:sudo yum install taglib-devel

冲泡:冲泡安装标签库

MacPorts:sudo 端口安装 taglib

于 2015-01-30T01:53:06.377 回答