我正在尝试安装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软件中心)。
我发现的唯一类似问题是this one,但我已经尝试明确定义了opt-dir
和opt-include
这两种方法都无济于事。
我必须承认我对这个主题甚至Ubuntu都不是很熟悉,所以我可能会忽略或完全错过关于错误信息的明显错误。
答案 0 :(得分:0)
Debian / Ubuntu:sudo apt-get install libtag1-dev
Fedora / RHEL:sudo yum install taglib-devel
Brew:brew install taglib
MacPorts:sudo port install taglib