Bug 30356 - library function error
Summary: library function error
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.5
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-03 00:19 UTC by Ryan McCoskrie
Modified: 2007-01-03 02:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan McCoskrie 2007-01-03 00:19:59 UTC
when compiling a program which uses the file iostream gcc exits due to invalid references.

an example:

#include <iostream>

void main()
{
   std::cout << "This won't work \n";
}

Will result in:

/tmp/ccd16f9g.o(text + 0x35): In function '__static_initionalization_and_destruction_0(int, int)': undefined reference to 
'std:ios__base:std:Init::Init[in charge]()'

followed by others of simmiler content.

This bug was found on a pentium 4 i686 machine running freespire linux 1.0.13
Comment 1 Andrew Pinski 2007-01-03 02:24:35 UTC
You are not linking against the libstdc++ library which contains the C++ standard library.

Either use g++ instead of gcc to link or link with -lstdc++.