Jump to content
  • Advertisement
Sign in to follow this  
methinks

Compiller error - Undeclared Identifier

This topic is 4998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created a separate class to handle the graphics functions of the program, but it keeps telling me that some of the variables are undefined. The variables are defined private, then set =NULL in the class'es constructor.
#ifndef GFXAPI_H
#define GFXAPI_H

#include <d3dx9.h>
#include "CCamera.h"

class gfxApi
{
public:
	gfxApi();
	~gfxApi();

	// ----- init -----
	bool init(HWND hWnd, bool fullscreen);
	void shutDown();

	// ----- loop -----
	void render();

private:

	LPDIRECT3D9			d3dApp;
	LPDIRECT3DDEVICE9	d3dRender;

	LPD3DXMATRIXSTACK	MatrixStack;
	D3DXMATRIXA16		view;

	CCamera	camera;
};

#endif	//GFXAPI_H

Here are the error messages that it gives me, in case it helps any:
Compiling...
core.cpp
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
gfxApi.cpp
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(30) : error C2065: 'd3dApp' : undeclared identifier
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(30) : error C2440: '=' : cannot convert from 'struct IDirect3D9 *' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(41) : error C2227: left of '->GetAdapterDisplayMode' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(48) : error C2227: left of '->GetDeviceCaps' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(81) : error C2227: left of '->CreateDevice' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(81) : error C2065: 'd3dRender' : undeclared identifier
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(97) : error C2227: left of '->SetRenderState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(100) : error C2227: left of '->SetRenderState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(101) : error C2227: left of '->SetRenderState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(102) : error C2227: left of '->SetRenderState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(103) : error C2227: left of '->SetRenderState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(109) : error C2227: left of '->SetSamplerState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(110) : error C2227: left of '->SetSamplerState' must point to class/struct/union
e:\organized\programming\bcit\comp2442\out\framework\gfxapi.cpp(119) : error C2065: 'MatrixStack' : undeclared identifier
Skipping... (no relevant changes detected)
main.cpp
Error executing cl.exe.
Thanks for taking the time to look

Share this post


Link to post
Share on other sites
Advertisement
Not enough info. There's nothing wrong with this header file. Has to be a problem in a file that includes it (or in CCamera.h).

Share this post


Link to post
Share on other sites
My bad

It was a stupid mistake in my imlementation. I declared my function
bool init(HWND hWnd, bool fullscreen) 

instead of
bool gfxApi::init(HWND hWnd, bool fullscreen) 


Thanks again

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!