Sign in to follow this  
Jazonxyz

Help with "LPDIRECT3DSURFACE9 * Knight already declared in Game.obj" error message

Recommended Posts

Jazonxyz    138
Why does my compiler show: LPDIRECT3DSURFACE9 * Knight already declared in Game.obj if my compiler used to compile the same code without any problem? EDIT: "HELP" is not an appropriate subject line. [Edited by - jollyjeffers on May 4, 2007 11:20:26 AM]

Share this post


Link to post
Share on other sites
Malazar    152
try cleaning your build (or deleting the contents of your debug folder, it amounts to the same thing).

this somtimes clears up this error.

Share this post


Link to post
Share on other sites
Most likely you define your variable it in a .h files.

In your .h file, declare that the variable exists with "extern". In ONE .cpp file, actually put the variable there. Any file that includes the .h will be able to refer to the variable.

In knight.h
extern LPDIRECT3DSURFACE9 Knight;

In knight.cpp
LPDIRECT3DSURFACE9 Knight = 0;

In any other .cpp
#include "knight.h"
...code here can see knight.cpp's Knight variable.

Share this post


Link to post
Share on other sites
Jazonxyz    138
Quote:
Original post by Jazonxyz
Why does my compiler show:

LPDIRECT3DSURFACE9 * Knight already declared in Game.obj

if my compiler used to compile the same code without any problem?

EDIT: "HELP" is not an appropriate subject line.


Error Fixed :-)

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