C++ Templates and symbols not defined in .o files

Ian Lance Taylor iant@google.com
Mon Sep 20 21:07:00 GMT 2010


Wesley Smith <wesley.hoke@gmail.com> writes:

> The problem is that when I go to use it in a .cpp file, the symbol for
> this function is U (undefined) instead of W (weak) as it should be.
> For example, I have a couple of .cpp files that use the exact same
> code, just changing the class T the template is based on.  In all but
> 1 of the .o files resulting, the symbol is W.  What's strange is that
> I'm compiling these files with exactly the same flags.

Can you show us a standalone test case?

Ian



More information about the Gcc-help mailing list