-x option for gcc

Anitha Boyapati anithab@sankhya.com
Fri Oct 20 06:56:00 GMT 2006


Hi,

 [I am literally a novice.Kindly bear with me]

 I wrote a c++ program (test.cc) which runs well with g++.
 Now I tried to compile with with gcc now :

 gcc -x c++ test.cc
  
 Now the compiler shouts at me saying there are some undefined references.
 (The list is truly long compared to the source program).

------------------------------------------------------------------
 For instance :

 [root@linux3 root]# gcc -x c++ test.cc
/tmp/ccjD2gLW.o(.text+0xc8): In function `main':
: undefined reference to `std::cout'
/tmp/ccjD2gLW.o(.text+0xcd): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> 
>& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, 
std::char_traits<char> >&, char const*)'

 --------------------------------------------------------------------


 Surely I am missing something.Can somebody help me as a start?
 
 (my version is gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)) 

  Thanks in advance.

-- 
Regards,
Anitha B,




More information about the Gcc-help mailing list