Sign in to follow this  
Gamesmaster3

Untitled

Recommended Posts

I can't understand what I've done wrong.I was trying to complete this program that would make a slideshow.Indivually all the cpp files have no errors.Can't seem to check the header files but when I go to Build the project I keep getting this.
inking...
slideshow.obj : error LNK2001: unresolved external symbol "public: __thiscall Bitmap::Bitmap(struct HDC__ *,int,int,unsigned long)" (??0Bitmap@@QAE@PAUHDC__@@HHK@Z)
slideshow.obj : error LNK2001: unresolved external symbol "public: __thiscall Bitmap::Bitmap(struct HDC__ *,unsigned int,struct HINSTANCE__ *)" (??0Bitmap@@QAE@PAUHDC__@@IPAUHINSTANCE__@@@Z)
slideshow.obj : error LNK2001: unresolved external symbol "public: __thiscall Bitmap::Bitmap(struct HDC__ *,char *)" (??0Bitmap@@QAE@PAUHDC__@@PAD@Z)
slideshow.obj : error LNK2001: unresolved external symbol "public: void __thiscall Bitmap::Draw(struct HDC__ *,int,int)" (?Draw@Bitmap@@QAEXPAUHDC__@@HH@Z)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Slideshow.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.

Slideshow.exe - 6 error(s), 0 warning(s)

Clicking on them reveals nothing.They won't go to a specific section of code or anything.Can anyone tell me what this error means and generally what I will have to do to fix it.I can only assume it has something to do with the Bitmap.h file.I've included that file with this
//---------------------------------------------------------------------
//-------------------Making a New Bitmap Class------------------------
class Bitmap
{
protected:
	//Member Variables
	HBITMAP  m_hBitmap; //Stores the handle to a bitmap
	int m_iWidth, m_iHeight; //Store width and height of a bitmap

	//Helper Variables
	void Free(); //This will be used to free up memory associated with bitmap
public:
	//Constructor(s)/ Destructor
	Bitmap();
	Bitmap(HDC hDC,LPTSTR szFileName); //Bitmap based on file
	Bitmap(HDC hDC,UINT uiResID,HINSTANCE hInstance); //Resources
	Bitmap(HDC hDC,int iWidth,int iHeight,COLORREF crColor = RGB(0,0,0));//Blank Solid Color
	virtual ~Bitmap(); //Destructor

	//General Methods
	//These correspond to the different Bitmap() functions above
	BOOL Create(HDC hDC,LPTSTR szFileName); 
	BOOL Create(HDC hDC,UINT uiResID, HINSTANCE hInstance);
	BOOL Create(HDC hDC,int iWidth, int Height,COLORREF crColor);
	void Draw(HDC hDC, int x,int y);
	int GetWidth() { return m_iWidth;};
	int GetHeight() { return m_iHeight;};
};


Share this post


Link to post
Share on other sites
You have declared the functions (in the class) but you haven't actually defined (/filled) your functions yet. You should at least put a dummy for the functions.

Share this post


Link to post
Share on other sites
Ok...... I pretty much have everything the book told me to have.I guess I will have to go looking to see if I missed something.I tell you this isn't the first exercise that this guy Morrison has done like this either.

Thanks alot for letting me know what's going on

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this