Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Undefined Reference During Make

Help
diilbert
2006-07-15
2013-05-20
  • diilbert
    diilbert
    2006-07-15

    I am using the latest version of libid3 (3.8.3) and am getting the following errors (There are a lot so I am just posting a few lines):

    /usr/local/lib/libid3.so: undefined reference to `operator new(unsigned int)'
    /usr/local/lib/libid3.so: undefined reference to `compress'
    /usr/local/lib/libid3.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)'
    /usr/local/lib/libid3.so: undefined reference to `std::__throw_out_of_range(char const*)'
    /usr/local/lib/libid3.so: undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_mutate(unsigned int, unsigned int, unsigned int)'
    /usr/local/lib/libid3.so: undefined reference to `VTT for std::basic_fstream<char, std::char_traits<char> >'
    /usr/local/lib/libid3.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_destroy(std::allocator<char> const&)'
    /usr/local/lib/libid3.so: undefined reference to `std::basic_istream<char, std::char_traits<char> >::seekg(std::fpos<__mbstate_t>)'
    /usr/local/lib/libid3.so: undefined reference to `virtual thunk to std::basic_istream<char, std::char_traits<char> >::~basic_istream()'
    /usr/local/lib/libid3.so: undefined reference to `virtual thunk to std::basic_ostream<char, std::char_traits<char> >::~basic_ostream()'
    /usr/local/lib/libid3.so: undefined reference to `typeinfo for std::basic_istream<char, std::char_traits<char> >'
    /usr/local/lib/libid3.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned int)'
    collect2: ld returned 1 exit status

    Any ideas would be appreciated. :- )

     
    • Stranger
      Stranger
      2007-11-18

      I've had this problem before and up until now have been unable to figure it out. I started having the same errors that you describe and after much searching and a bit of testing it seems that the compiler is missing a few flags when it tries to create the binaries. That leaves you with two options; either way start by extracting the source.

      Option one is to add "-lstdc++ -lz" at the end of line 14 in src/Makefile.in ("LDFLAGS = @LDFLAGS@ @LIBS@ -lutil -lid3"), then proceed as normal (configure, make, make install).

      Option two is to run configure as normal then add "-lstdc++ -lz" at the end of line 14 in src/Makefile ("LDFLAGS = <bunch of flags>").

      Either way will add the two flags to the make binary step and should solve the problem. It worked for me on a fresh install of Slackware 12 (after installing id3lib).