• Advertisement
Sign in to follow this  

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

This topic is 3914 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

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement