Hi im kinda new to c++ and dont know mutch aboute unsolved externals

this is what i get:

pices.obj : error LNK2019: unresolved external symbol "private: int __thiscall Pices::MovePawn(int,int,int,int,struct Piece (* const)[12])" (?MovePawn@Pices@@AAEHHHHHQAY0M@UPiece@@@Z) referenced in function "public: int __thiscall Pices::MovePlayer(int,int,int,int,struct Piece (* const)[12])" (?MovePlayer@Pices@@QAEHHHHHQAY0M@UPiece@@@Z)
pices.obj : error LNK2019: unresolved external symbol "private: int __thiscall Pices::MoveKing(int,int,int,int,struct Piece (* const)[12])" (?MoveKing@Pices@@AAEHHHHHQAY0M@UPiece@@@Z) referenced in function "public: int __thiscall Pices::MovePlayer(int,int,int,int,struct Piece (* const)[12])" (?MovePlayer@Pices@@QAEHHHHHQAY0M@UPiece@@@Z)
pices.obj : error LNK2019: unresolved external symbol "private: int __thiscall Pices::MoveBishop(int,int,int,int,struct Piece (* const)[12])" (?MoveBishop@Pices@@AAEHHHHHQAY0M@UPiece@@@Z) referenced in function "public: int __thiscall Pices::MovePlayer(int,int,int,int,struct Piece (* const)[12])" (?MovePlayer@Pices@@QAEHHHHHQAY0M@UPiece@@@Z)
pices.obj : error LNK2019: unresolved external symbol "private: int __thiscall Pices::MoveKnite(int,int,int,int,struct Piece (* const)[12])" (?MoveKnite@Pices@@AAEHHHHHQAY0M@UPiece@@@Z) referenced in function "public: int __thiscall Pices::MovePlayer(int,int,int,int,struct Piece (* const)[12])" (?MovePlayer@Pices@@QAEHHHHHQAY0M@UPiece@@@Z)
pices.obj : error LNK2019: unresolved external symbol "private: int __thiscall Pices::MoveRook(int,int,int,int,struct Piece (* const)[12])" (?MoveRook@Pices@@AAEHHHHHQAY0M@UPiece@@@Z) referenced in function "public: int __thiscall Pices::MovePlayer(int,int,int,int,struct Piece (* const)[12])" (?MovePlayer@Pices@@QAEHHHHHQAY0M@UPiece@@@Z)
C:\Documents and Settings\Alexander\Mina dokument\Visual Studio 2010

this is the pice header

struct Piece
{
	char colorPiece;  // color = B(lack) or W(hite)
	char typePiece;     //Type = The type of Pices
	int	 health;
};

class Pices
{
public:
	int MovePlayer(int pieceX, int pieceY, int destinationX, int destinationY, struct Piece Chessboard[12][12]);
private:
	int MoveRook(int pieceX, int pieceY, int destinationX, int destinationY, struct Piece Chessboard[12][12]);
	int MoveBishop(int pieceX, int pieceY, int destinationX, int destinationY, struct Piece Chessboard[12][12]);
	int MovePawn(int pieceX, int pieceY, int destinationX, int destinationY,  struct Piece Chessboard[12][12]);
	int MoveKing(int pieceX, int pieceY, int destinationX, int destinationY, struct Piece Chessboard[12][12]);
	int MoveKnite(int pieceX, int pieceY, int destinationX, int destinationY, struct Piece Chessboard[12][12]);
};

#endif // Picess_h__

this is how i call movePlayer

Pices.MovePlayer( x, y, destinationX, destinationY, Chessboard)

witch calls the other functions in this way

MoveRook(pieceX,pieceY,destinationX,destinationY,Chessboard)

Recommended Answers

All 2 Replies

Looks like you haven't included the cpp files in the project (or didn't actually implement the member functions of Pices ).

Also, you know that a chess board is 8x8, right? Not 12x12.

i know but this project got 12,but thanks forgot to change some declarations in the ai functions

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.