• Advertisement
Sign in to follow this  

Error Accessing a Structure

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

Hi!
I've declared a struct named CameraType globally in a file called GameManager.h. I'm trying to access it like this: CameraType cType; in a file called GamePlayState.cpp. I got the following error:

IntelliSense: identifier "CameraType" is undefined d:\goldminer\source\game\gameplaystate.cpp 109

I've also included the GameManager.h file to the GamePlayState.cpp file. How to overcome this error?



[Edited by - ratha on October 14, 2010 7:49:50 AM]

Share this post


Link to post
Share on other sites
Advertisement

struct CameraType
{
core::vector3df FRONTCAM;
core::vector3df BEHINDCAM;
core::vector3df TOPCAM;
};



I'm creating a variable of this structure in another file called GamePlayState.cpp like this:

CameraType cType;

inside a function.

Share this post


Link to post
Share on other sites
Did you put an extern declaration for cType in your header?

Share this post


Link to post
Share on other sites
Um... Shouldn't that be
typedef struct
{
core::vector3df FRONTCAM;
core::vector3df BEHINDCAM;
core::vector3df TOPCAM;
} CameraType;
instead?

Share this post


Link to post
Share on other sites

IntelliSense: identifier "CameraType" is undefined d:\goldminer\source\game\gameplaystate.cpp 109


Erm, does the build actually fail? Because this message looks more like IntelliSense is confused than like a compiler error. (Or did you just copy the error message from some mouse-over window?)

Share this post


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

  • Advertisement