[GRLUG] C and C++ Development and GCC

Jeff DeFouw jeffd at i2k.com
Sat Sep 9 22:13:46 EDT 2006


On Sat, Sep 09, 2006 at 08:19:07PM -0400, Carlus Henry wrote:
> As you can see from this link it is just a simple Hello World program.
> However, when I try to compile it using gcc-3.4.3, I get the error
> attached.  If anyone has any experience developing C++ and has a clue on the
> problem that I am currently facing and how to resolve it, that would be
> greatly appreciated.

> #include <iostream>
> using namespace std;
> 
> int main() {
>   cout << "\nHello World!!!\n";
>   return 0;
> }

Compiles and runs without errors here.  I used gcc 3.4.6 on Debian 
unstable.

> /home/shenry/tmp/ccMpkNJv.o(.text+0xd): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
> : undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'

I haven't seen this, but it looks like mismatched libraries/compiler.  
The C++ libraries have gone through several major upgrades in the past 
few years and the libraries and compiler all have to match.  If your 
compiler and libraries are part of your distribution, looks like the 
maintainers weren't careful enough.  Look for updated packages specific 
to your distribution.

-- 
Jeff DeFouw <jeffd at i2k.com>


More information about the grlug mailing list