Sign in to follow this  
Jesbass

Errors In Visual Studio 2005

Recommended Posts

I have just upgraded from Visual Studio 2003 to Visual Studio 2005. I've downloaded, installed, and linked the February 2006 SDK. But there are now a heap of errors that weren't present before the upgrade, such as the one below. Can anyone help me? There are a few links that still don't work, but the typical error goes as follows: e:\gamedev\shared\2dgamelib\singleton.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\gamedev\shared\2dgamelib\display.h(83) : see reference to class template instantiation 'CSingleton<T>' being compiled with [ T=CDisplay ] There are approximately 90 of these. The code this is referring to is the first line:
class CDisplay : public CEntity, public CSingleton<CDisplay>
{
	friend CSingleton<CDisplay>;
	
	// Member Variables
public:

protected:
	Int32			m_iWidth,
					m_iHeight;

	bool			m_bIsWindowed;

	CSTLRenderMap	m_mapRenderMap;

	dd::Renderer	m_Renderer;

private:

	// Member Functions
public:

	virtual void Process();

	virtual bool Initialize(const Int8*		pcIniFileName);

	Int32 GetWidth() const
	{
		return m_iWidth;
	}

	Int32 GetHeight() const
	{
		return m_iHeight;
	}

	void GetWindowPos(Int32& _x,Int32& _y);

	//void SetWindowPos(Int32 _x, Int32 _y);

	bool IsWindowed() const
	{
		return m_bIsWindowed;
	}

	dd::Renderer&	GetRenderer()
	{
		return m_Renderer;
	}

	void OnResetDevice();

	bool AddRenderEntity(CRenderEntity*		_pRenderEntity);

	bool RemoveRenderEntity(CRenderEntity*	_pRenderEntity);

	void Draw();

protected:
	CDisplay();

	virtual ~CDisplay();

private:

};

#endif	// __DISPLAY_H__

This is so frustrating. All I want to do is keep programming, but I'm getting a heap of errors and warnings. :(

Share this post


Link to post
Share on other sites
Yes, that's display.h.

Line 53 of singleton.h goes as follows:
	static DestroyInstance()
{
ASSERT(m_pTheInstance);

delete m_pTheInstance;
m_pTheInstance = NULL;
};


Again, all of this code used to work fine. :/

Share this post


Link to post
Share on other sites
Quote:
Original post by diablo2_v
For the singleton problem you have to specify a return type for your function.

So static void DestroyInstance().

That should fix it for you.


Doing that gives me a linker error:

LINK : fatal error LNK1104: cannot open file 'ddLibD.lib'

ddLib is the name of a library I have to link to. Any ideas? :/

Share this post


Link to post
Share on other sites
You may have to set up the VC++ Directories, so that it knows where your lib file is.

To do this you must open visual studio, Click Tools > Options.

Under Projects + Solutions Click VC++ Directories.

Where it says 'Show Directories for', choose Library Files.

If the path to your lib file is not there, you can add a new path (little folder icon).

Hope this helps you out.

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