C++ question

674b33a27556c50fd4d62b2faf9479e3
0
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.

674b33a27556c50fd4d62b2faf9479e3
0
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

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Feb 07, 2014 at 07:32

are you sure you are fully linked and included?

A8433b04cb41dd57113740b779f61acb
0
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?