Question

I'm trying to install id3lib-ruby, but I'm getting this error:

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 ***

I've got all kinds of libstdc++ installed:

$ 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)

Here's the 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 */

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

Any idea on what I'm doing wrong or how to fix it?

Was it helpful?

Solution

You probably solved your problem in the meantime, but since I had a similar issue recently and got help here, I thought I might share that apt-get install build-essential solved my missing libstdc++ error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top