0

Errors:

1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(239): error C2065: 'string' : undeclared identifier
1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(239): error C2146: syntax error : missing ';' before identifier 'str'
1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(239): error C2065: 'str' : undeclared identifier

Code: string str;

For some reason strings are giving me errors.

5
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by Ancient Dragon
0

Maybe strings are giving you errors because you forgot to declare them - just like you forgot to post your code.

0

I did include the string library. The errors are with that one line. I was thinking I made a small mistake that I didn't notice.

0

Perhaps a namespace issue? Do you have either of these after the #include <string> line?

using namespace std;
using std::string;

Alternately, you can replace string str; with std::string str;

Edited by VernonDozier: Code tags.

0

I accidently erased the using namespace std; while messing with the definitions.
Hahaha, I feel like such an idiot now.

This topic has been dead for over six months. 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.