Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Help need with an error

This topic is 5989 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, after coding a CWorld class to handle all my objects in the world i was faced with an error that really can''t solve. error C2838: illegal qualified name in member declaration The compiler points to CWorld contructor. All my objects(3d models for example) are derived from a class called CObjects, CObjects is derived from a class called CNode. Hope you understand it. If you need for information, just say it. Thanks and bye.

Share this post

Link to post
Share on other sites
You should propbably include some code so we can see where the error occurs.

Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home

Share this post

Link to post
Share on other sites
The error occurs when compiling world.cpp
Here is a bit of code.

// World.cpp
#include <windows.h>

#include "World.h"

// Constructor
{ // <-- compiler points to HERE.
this -> cube = NULL;
// this -> map = NULL;
this -> player = NULL;

this -> player = new CPlayer;
this -> cube = new CCube;

this -> player -> AttachNode(this -> cube);

And now here''s the class definition:

// world.h
#ifndef WORLD_H
#define WORLD_H

#include "Cube.h"
#include "Player.h"

class CWorld

// CMap *map;
CCube *cube;
CPlayer *player;


void Draw();

void Load();


If you need something more, just say it.
Hope the error isn''t my eyes, if you know what i mean.

Share this post

Link to post
Share on other sites
After having had a look at the error-message you describe at MSDN ( I''m assuming you''re using VC++ ), I''m leaning towards there being a problem in "cube.h" or "player.h" ( most likely in player.h ) with closing curly braces.
For a (not very ) detailed description of the error-message, check this link, or this link ( the information found in both these links are practically identical ).


Share this post

Link to post
Share on other sites

  • 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!