Re: C++ static member function reported as undefined references by linker?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



He was trying to use an old gcc version to compile some code that had
a global namespace declared class and static class method.

The issue was that the static class method wasn't given external
linkage in that version without declaring the class in a named
namespace.

For about a day, I mistakenly said it was appropriate behavior because
the class wasn't declared in a proper namespace, but after coming to
my senses and the spec, it clearly should have external linkage now
(2003 spec).

I gave him the work-a-round for that old gcc to simply declare the
class inside of a named namespace instead of global namespace.

corey

On 11/5/05, Nathan Sidwell <nathan@xxxxxxxxxxxxxxxx> wrote:
> David Cespedes wrote:
> > Can you help with this issue, in regards to C++ static member functions and why they are reported as undefined references by the linker?
> >
> > Please see attached email trail!
>
> please provide a complete test case, I can't figure out from the email trail
> what you;re trying to compile.
>
> nathan
>
> --
> Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
> nathan@xxxxxxxxxxxxxxxx    ::     http://www.planetfall.pwp.blueyonder.co.uk
>
>


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux