c++libtcod

C++ with libtcod not allowing TCODColor type declaration


I am attempting to make a simple rouge like game with c++ and libtcod. I am attempting to compile code that declares a col variable with TCODColor

TCODColor col;

and this is the actual error:

error: TCODColor does not name a type

The error occues in the header file but I have included the necessary #include "libtcod.h" in the .cpp file. I have no idea why it will not allow me to declare this type. Any ideas?


Solution

  • You want to include libtcod.hpp not libtcod.h, the latter is for C, not C++ and TCODColor is in the C++ version.