Cary <[email protected]> writes:
> The following code compiles, but the linker complains of an undefined
> reference. If I comment out the line with *xx* it will link. Is this
> a known and/or fixed bug in later versions of gcc?
No. It's a bug in your program.
> SLES 10.2
> gcc --version gcc (GCC) 4.1.2 20070115 (SUSE Linux)
>
> replace.cpp:
> #include <algorithm>
> #include <vector>
> class A
> {
> private:
> const static int k1 = 1;
This just declares k1. It does not define it.
> std::vector<int> mv;
> public:
> A(int p);
> };
Add
int const A::k1;
to define k1.
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus