0

I am writing a program using strings to pass messages into SDL functions. For some reason the compiler will not let me create any string objects though. I get a 'string' undeclared error when I try to compile this code:

#include "SDL/SDL.h"
#include "SDL/SDL_ttf.h"
#include <string>

int errorMessage(int errorNumber)
{
...
      string::string error_message_string;
      string::string error_title;

Any suggestions? I am not using namespace std.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by dmanw100
0

I am writing a program using strings to pass messages into SDL functions. For some reason the compiler will not let me create any string objects though. I get a 'string' undeclared error when I try to compile this code:

#include "SDL/SDL.h"
#include "SDL/SDL_ttf.h"
#include <string>

int errorMessage(int errorNumber)
{
...
      string::string error_message_string;
      string::string error_title;

Any suggestions? I am not using namespace std.

Try changing string::string to std::string .

0

Oh dang yeah! Haha I knew that too! It's been one of those days... thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.