GCC 4 + no inline template functions => undefined symbol ! ?

Eljay Love-Jensen eljay@adobe.com
Fri Jul 1 13:50:00 GMT 2005


Hi Sébastien,

>May be gcc 4 just support inline functions for templates? (but why gcc 3.4 has no problem with that?)

GCC 4 supports non-inline functions for templates for me, just fine.

template <typename T>
T NonInline(T input)
{
    return input - 1;
}

template <typename T>
inline T Inline(T input)
{
    return input + 1;
}

int main()
{
    int i = 10;
    i = NonInline(i);
    i = NonInline(i);
    i = NonInline(i);
    i = NonInline(i);

    int j = 10;
    j = Inline(j);
    j = Inline(j);
    j = Inline(j);
    j = Inline(j);
}

Sincerely,
--Eljay



More information about the Gcc-help mailing list