M
Martin Magnusson
Hi
I have a class with a public const static variable, and I get a number
of undefined references to it when linking. The code looks like below.
When referencing the variable from other files I use
MaxNode::NO_ARGUMENT. Am I missing something in the definition here,
or would it seem that the problem lies elsewhere?
//MaxNode.hpp:///////////////////
class MaxNode
{
public:
const static double NO_ARGUMENT;
// (etc...)
};
//MaxNode.cpp:////////////////////
#include "MaxNode.hpp"
const static double NO_ARGUMENT = 1123;
// (etc...)
I have a class with a public const static variable, and I get a number
of undefined references to it when linking. The code looks like below.
When referencing the variable from other files I use
MaxNode::NO_ARGUMENT. Am I missing something in the definition here,
or would it seem that the problem lies elsewhere?
//MaxNode.hpp:///////////////////
class MaxNode
{
public:
const static double NO_ARGUMENT;
// (etc...)
};
//MaxNode.cpp:////////////////////
#include "MaxNode.hpp"
const static double NO_ARGUMENT = 1123;
// (etc...)