C++ question

woodelv 101 Feb 06, 2014 at 17:26

Hi, i’m new to this forum and i apologize in advance if this is in the wrong topic or something like that… :O

I’ve been checking out the C++ totorials by NHTV -> IGAD on this website (http://devmaster.net/posts/2844/introduction-to-c-with-game-development-part-2-project-template)

But in the second tutorial i’m stuck with the assignment. It says that you have to create a code that will draw IGAD, when i type my interpretation of the lines of code:

m_Surface->Line( 80, 60, 80, 420, 0xffffff); (This is one exemplary line, i have 13 others that are in fact just the same, except for the parameters) I get the following error: 1>c:\my_projects\template\game.cpp(28) : error C2065: ‘m_Surface’ : undeclared identifier 1>c:\my_projects\template\game.cpp(28) : error C2227: left of ‘->Line’ must point to class/struct/union/generic type 1> type is ‘‘unknown-type’’ Since I’ve only been doing C++ for two hours, this is kinda overwhelming. Can anybody help me out?

Kind regards, Tim

3 Replies

Please log in or register to post a reply.

woodelv 101 Feb 06, 2014 at 17:31

It does help if i change m_Surface to m_Screen, but I find this quite weird since the tutorial states that it should be m_surface

rouncer 103 Feb 07, 2014 at 07:32

are you sure you are fully linked and included?

Reedbeta 167 Feb 07, 2014 at 07:42

It’s saying that it can’t find the variable called m_Surface, which should be available inside any of the Game::Blabla functions. Does the tutorial compile and run ok before you started modifying it for the assignment? If so, can you post all your changes?