2

我正在尝试安装 id3lib-ruby,但出现此错误:

Building native extensions.  This could take a while...
ERROR:  Error installing id3lib-ruby:
    ERROR: Failed to build gem native extension.

        /home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb
checking for main() in -lstdc++... no
You must have libstdc++ installed.
*** extconf.rb failed ***

我已经安装了各种 libstdc++:

$ apt-cache search libstdc | grep dev
lib32gmp-dev - Multiprecision arithmetic library developers tools (32bit)
libgmp-dev - Multiprecision arithmetic library developers tools
libstdc++6-4.4-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.6-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.5-dev - GNU Standard C++ Library v3 (development files)
libstdc++6-4.6-dev-armel-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.6-dev-armhf-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-dev-armel-cross - GNU Standard C++ Library v3 (development files)
libstdc++6-4.7-dev-armhf-cross - GNU Standard C++ Library v3 (development files)

这是 mkmf.log:

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

"/usr/bin/gcc-4.6 -o conftest -I/opt/local/include -I. -I/home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/x86_64-linux -I. -I/usr/local/include -I/opt/local/include -I/sw/include    -g -O2    conftest.c  -L. -L/home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/lib -Wl,-R/home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/opt/local/lib -Wl,-R/opt/local/lib -L/sw/lib -Wl,-R/sw/lib -L.  -rdynamic -Wl,-export-dynamic     -lruby-static -lstdc++  -L/opt/local/lib -lrt -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */

"/usr/bin/gcc-4.6 -o conftest -I/opt/local/include -I. -I/home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/x86_64-linux -I. -I/usr/local/include -I/opt/local/include -I/sw/include    -g -O2    conftest.c  -L. -L/home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/lib -Wl,-R/home/rfischer/.rvm/rubies/ree-1.8.7-2012.02/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/opt/local/lib -Wl,-R/opt/local/lib -L/sw/lib -Wl,-R/sw/lib -L.  -rdynamic -Wl,-export-dynamic     -lruby-static -lstdc++  -L/opt/local/lib -lrt -ldl -lcrypt -lm   -lc"
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { main(); return 0; }
/* end */

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

关于我做错了什么或如何解决它的任何想法?

4

1 回答 1

4

您可能同时解决了您的问题,但是由于我最近遇到了类似的问题并在这里得到了帮助,我想我可能会分享apt-get install build-essential解决了我丢失的 libstdc++ 错误的问题。

于 2013-06-02T10:19:09.127 回答