Anitha Boyapati wrote: > [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). The real question is why you would want to do this. Supplying "-x c++" does not have the same effect as invoking g++, which knows all the necessary libraries and options to pass on to the subprocesses. All -x does is set the type of language by which the file will be interpreted, but there is more to it. You will run into all kinds of problems by not invoking the g++ driver for C++ code. Brian