Weird error when creating object
Hi all,
I''ve got some code based on nehe''s latest basecode. i''ve added a camera class that compiles fine(after a lot of little errors). But when I try to create a camera object with
Camera camera;
I get some weird errors!
these are the errors i get:
C:\Program Files\Microsoft Visual Studio\MyProjects\EdnaEngine\Draw.cpp(36) : error C2146: syntax error : missing '';'' before identifier ''camera''
C:\Program Files\Microsoft Visual Studio\MyProjects\EdnaEngine\Draw.cpp(36) : error C2501: ''Camera'' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\EdnaEngine\Draw.cpp(36) : fatal error C1004: unexpected end of file found
This is the code, from the start of the example file:
//Defines
#define MAP_X 32
#define MAP_Z 32
#define MAP_SCALE 20.0f
#define PI 3.14159
Camera camera; <<<<<<--------ERROR LINE
//Mouse Camera variables
int mX,mY;
float cameraX, cameraY, cameraZ;
float lookX, lookY, lookZ;
float angle=0.0f;
I added the lines directly above and under the line of code that causes the error
Anyone know what the problem could be?????
anyhelp is appreciated.
NICK
Hi
Did You include header files something like this
#include "camera.h"
Other words you have to include file where class Camera is defined.
[Edit] It don't have to exacly by camera.h file, i gived only an example[/Edit]
"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We Would
When Losers Say Its Over With You Know That It’s A Lie The Gods Made Heavy Metal And It’s Never Gonna Die"
THE GODS MADE HEAVY METAL/by ManOwaR
[edited by - Estor on March 16, 2004 2:42:36 PM]
Did You include header files something like this
#include "camera.h"
Other words you have to include file where class Camera is defined.
[Edit] It don't have to exacly by camera.h file, i gived only an example[/Edit]
"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We Would
When Losers Say Its Over With You Know That It’s A Lie The Gods Made Heavy Metal And It’s Never Gonna Die"
THE GODS MADE HEAVY METAL/by ManOwaR
[edited by - Estor on March 16, 2004 2:42:36 PM]
"The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We WouldWhen Losers Say Its Over With You Know That It's A Lie The Gods Made Heavy Metal And It's Never Gonna Die"THE GODS MADE HEAVY METAL/by ManOwaR
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement