printing the c++ name mangling
<p>I am reading a c++ book which states that linker is usually passed mangled names as opposed to    original names. So, i am trying to see what mangled names would look like. Hence, i created a class called Test, which just includes function signatures and saved it to a file called name_mangling.cpp</p>

<p>Then in the main method, i call those functions. I first compiled the file to .o and then tried linking it with command such as  </p>

<pre><code>g++ -o name_mangling name_mangling.o
</code></pre>

<p>I was hoping to see mangled names, but g++ printed actual names such as </p>

<pre><code>undefined reference to `Test::Test(char const*)'
</code></pre>

<p>but on the other hand, i have seen, mangled names, when i try to link to a shared object such as .so. Why does g++ prints the mangled names in case of .so and not the above case?</p>
