I have a simple 2 dimensional vector class, which is implemented as inline functions/operators.
However when I want to instantiate my Vector with no parameters I get Unresolved externals error and I'm not sure why. However, when I use other constructor with parameters it's ok.
This is my class:
class Vector2
{
public:
float x;
float y;
public:
//Constructors
Vector2() : x(0.0f), y(0.0f) {}
Vector2(const float _x, const float _y) : x(_x), y(_y) { }
};
Creating instance which causes error:
Vector2 a();
But when instantiating with other constructor it's ok. This also works:
Vector2 a = Vector2();
I'm getting this:
1>main.obj : error LNK2019: unresolved external symbol "class GreenEye::Maths::Vector2 __cdecl a(void)" (?a@@YA?AVVector2@Maths@GreenEye@@XZ) referenced in function main
1>X:\Development\Projects\Engine\x64\Debug\Test.exe : fatal error LNK1120: 1 unresolved external
Any ideas? Thanks.