title: C++ programs, compiling with g++
body: <p>I am very aware of compiling C++ programs with g++ in linux environment. But, may be I am missing something, I am getting this strange output/behaviour.</p>
  
  <p>I have source file in test.cpp.
  To compile this, I did</p>
  
  <pre>
  (1)
  g++ -c test.cpp 
  g++ -o test test.o
  ./test
  </pre>
  
  <p>Everything works fine. 
  But when I did compling and linking in same stage, like this</p>
  
  <pre>
  (2)
  g++ test.cpp -o test 
  ./test => Works fine
  (3)
  g++ -c test.cpp -o test => Doesn't work
  </pre>
  
  <p>In my last case, test is generated but is no more executable; but in my guess it should work fine.
  So, what is wrong or do I need to change some settings/configuration ??</p>
  
  <p>I am using g++ 4.3.3</p>
  
  <p>Thanks.</p>