header.h
namespace VectorMath {
static FVector Make(float X, float Y, float Z);
}
file.cpp
namespace VectorMath {
static FVector Make(float X, float Y, float Z)
{
FVector ret;
ret.X = X;
ret.Y = Y;
ret.Z = Z;
return ret;
}
}
错误
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring(541): error C2129: static function ‘FVector VectorMath::Make(float,float,float)’ declared but not defined
1> c:\programming****\vectormath.h(19) : see declaration of ‘VectorMath::Make’
错误指向xstring(标准字符串库的一部分)第541行,它似乎与任何东西都没有任何关系.
我想要注意,删除“静态”会给我链接器错误,告诉我“Make”是一个未解析的外部符号……