1

I am attempting to follow the tutorial found here to learn the basic idea behind programming roguelike game. I am using Code::Blocks 10.05 running portable from my usb and compiling with MinGW. Console.h also came from the website I linked above.

I have hit a road block when I have attempted to set up just this class to ensure everything is working:

#include <conio.h>
#include "Console.h"

int main( void )
{
    console.Clear();
    return 0;
}

When I attempt to use the I get the following error:

Error: request for member 'Clear' in 'console', which is of non-class type 'Win32Console()'|

Any help is appreciated, thanks!

Edit

I reinstalled MinGW and Code::Blocks after promptly ruining them for myself and am now back with the error:

undefined reference to `Win32Console::Win32Console()

BradyK
  • 387
  • 1
  • 9
  • 1
    I downloaded the header and it all looked fine. Win32Console is definitely a class. What compiler are you using? – user1610015 Oct 23 '12 at 21:02
  • That compiles cleanly for me. Your error suggests `console` is a function, though, such as `Win32Console console();`. Look in the header and make sure it's `Win32Console console;`. – chris Oct 23 '12 at 21:07
  • What did you change when it was giving you an undefined reference? That meant it compiled before, and isn't now, so something you changed should be causing this. – chris Oct 23 '12 at 21:20
  • I haven't changed anything that's what is confusing me. I have linked the library and added the header to the project but only that line gives me the error – BradyK Oct 23 '12 at 21:47

1 Answers1

0

before adding the header file, paste this line: #define _WIN32. Its possible that the _WIN32 isn't defined?

Aniket Inge
  • 25,375
  • 5
  • 50
  • 78