This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
other/9274: [pch] Big troubles with v3
- From: pcarlini at unitus dot it
- To: gcc-gnats at gcc dot gnu dot org
- Date: 11 Jan 2003 15:18:23 -0000
- Subject: other/9274: [pch] Big troubles with v3
- Reply-to: pcarlini at unitus dot it
>Number: 9274
>Category: other
>Synopsis: [pch] Big troubles with v3
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Jan 11 07:26:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Paolo Carlini
>Release: g++ (GCC) 3.4 20030111 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu, glibc2.3.1, binutils2.13.2.1
>Description:
Consider:
<header.h>
#include <iostream>
#include <string>
<test1.cc>
#include "header.h"
int main()
{
std::cout << "Hello World!" << std::endl;
}
<test2.cc>
#include "header.h"
int main()
{
std::string str = "Hello World!";
std::cout << str << '\n';
}
After a 'g++ -x c++-header header.h', I get:
-test1.cc
/tmp/ccM9ZCnR.o: In function `main':
/tmp/ccM9ZCnR.o(.text+0x30): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'
collect2: ld returned 1 exit status
-test2.cc
/usr/local/gcc-exp/include/c++/3.4/bits/stl_algobase.h:149: warning: inline
function `const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = size_t]'
used but never defined
/usr/local/gcc-exp/include/c++/3.4/cmath:391: warning: inline function `_Tp
std::__pow_helper(_Tp, int) [with _Tp = double]' used but never defined
/usr/local/gcc-exp/include/c++/3.4/cmath:391: warning: inline function `_Tp
std::__pow_helper(_Tp, int) [with _Tp = float]' used but never defined
/usr/local/gcc-exp/include/c++/3.4/cmath:391: warning: inline function `_Tp
std::__pow_helper(_Tp, int) [with _Tp = long double]' used but never defined
/tmp/cc2tQmQg.o: In function `main':
/tmp/cc2tQmQg.o(.text+0x18): undefined reference to `std::allocator<char>::allocator[in-charge]()'
/tmp/cc2tQmQg.o(.text+0x32): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string[in-charge](char const*, std::allocator<char> const&)'
/tmp/cc2tQmQg.o(.text+0x45): undefined reference to `std::allocator<char>::~allocator [in-charge]()'
/tmp/cc2tQmQg.o(.text+0x5e): undefined reference to `std::allocator<char>::~allocator [in-charge]()'
/tmp/cc2tQmQg.o(.text+0x71): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/cc2tQmQg.o(.text+0x94): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string [in-charge]()'
/tmp/cc2tQmQg.o(.text+0xad): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string [in-charge]()'
collect2: ld returned 1 exit status
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: