LNK 1120 and LNK2019(unresolved external error)

I have been making this SDL game it's been working fine until now when i opened it and showed me these two errors the code is too lengthy it would be hard to paste how can i solve this error where do i need to search for it , it's taking so much time
Error 1 error LNK2019: unresolved external symbol "public: __thiscall player::player(struct SDL_Surface *)" (??0player@@QAE@PAUSDL_Surface@@@Z) referenced in function "public: __thiscall game::game(void)" (??0game@@QAE@XZ) C:\Users\Sharan Gohar\Documents\Visual Studio 2010\Projects\Sdl_setup\Sdl_setup\game.obj
Error 2 error LNK1120: 1 unresolved externals C:\Users\Sharan Gohar\Documents\Visual Studio 2010\Projects\Sdl_setup\Debug\Sdl_setup.exe


You certainly forgot to implement the constructor player(struct SDL_Surface *) in the class player

Look for that class and implement the constructor
The another possibility is that the object file that contains that implementation is not compiled/linked.
I have already made constructors for player class
//player.h
 
player(SDL_Surface *img);

//player.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
player::player(SDL_Surface *img)
{
image=img;
box.x=0;
box.y=0;
box.w=83;
box.h=80;
int xvel=0;
int yvel=0;
for(int i=0;i<3;i++)
{
clips[i].x=i*83;
clips[i].y=0;
clips[i].w=clips[i].h=0;
}
}
Sorry i found it the problem was that i didn't added existing file for player.cpp explicitly in header files folder in IDE i didn't know that was compulsory
Topic archived. No new replies allowed.