Currently trying to use vectors to store bullets in a game. when i attempt to use push_back to add a new object to the list i get an unresolved external symbol error. I've tried changing it to an integer and the vector works so i doubt its a linker error? my vector is initialised in my main CPP and is then passed a few times to this the function within a separate class.
Here's my code:
void Hero::shoot(std::vector<Bullet> bullets)
{
Bullet firedBullet();
bullets.push_back(firedBullet());
}
My error is:
LNK2019 unresolved external symbol "class Bullet __cdecl firedBullet(void)" (?firedBullet@@YA?AVBullet@@XZ) referenced in function "public: void __thiscall Hero::shoot(class std::vector >)" (?shoot@Hero@@QAEXV?$vector@VBullet@@V?$allocator@VBullet@@@std@@@std@@@Z) Project1 H:\C++\Project1\Project1\Hero.obj
Please Help.