This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re[2]: compiling programs with libstdc++


On 01 Aug 2001 23:25:26 -0300 aoliva@redhat.com wrote:

> On Aug  1, 2001, "Jason M'Sadoques" <jsado@mediaone.net> wrote:
> 
> > jlm /home/jlm/code2/temp 252>g++ -I/usr/include/g++-v3 dud.cpp
> 
> Did you try -fhonor-std ?
Thanks for the quick response. I added using namespace std;
and then recompiled with -fhonor-std and got the same linking errors:

jlm /home/jlm/code2/temp 261>g++ -fhonor-std -I/usr/include/g++-v3 dud.cpp
/tmp/ccx5BRT3.o: In function `main':
/tmp/ccx5BRT3.o(.text+0x17): undefined reference to `std::cout'
/tmp/ccx5BRT3.o(.text+0x1c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::ios_base &(*)(std::ios_base &))'
/tmp/ccx5BRT3.o(.text+0x27): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::ios_base &(*)(std::ios_base &))'
/tmp/ccx5BRT3.o(.text+0x34): undefined reference to `std::cout'
/tmp/ccx5BRT3.o: In function `__static_initialization_and_destruction_0':
/tmp/ccx5BRT3.o(.text+0x66): undefined reference to `std::ios_base::Init::Init(void)'
/tmp/ccx5BRT3.o(.text+0x7b): undefined reference to `std::ios_base::Init::~Init(void)'
/tmp/ccx5BRT3.o: In function `std::ios_base::failure type_info function':
/tmp/ccx5BRT3.o(.gnu.linkonce.t.__tfQ33std8ios_base7failure+0x10): undefined reference to `std::exception type_info function'
/tmp/ccx5BRT3.o(.gnu.linkonce.t.__tfQ33std8ios_base7failure+0x1a): undefined reference to `std::exception type_info node'
/tmp/ccx5BRT3.o: In function `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)':
/tmp/ccx5BRT3.o(.gnu.linkonce.t.__ls__Q23stdt13basic_ostream2ZcZQ23stdt11char_traits1Zci+0x67): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(unsigned long)'
/tmp/ccx5BRT3.o(.gnu.linkonce.t.__ls__Q23stdt13basic_ostream2ZcZQ23stdt11char_traits1Zci+0x7c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(long)'
collect2: ld returned 1 exit status

For reference again, here is my program:

//Test out libstdc++.

#include <iostream>
#include <ios>

using namespace std;
int main()
{
  cout << hex << showbase;
  cout << int(12);
}
--
MACINTOSH = Machine Always Crashes If Not The Operating System Hangs
"Life would be so much easier if we could just look at the source code." - Dave Olson


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]