|
Mingw C++ string is not a type ?? |
Ariesnl
Member #2,902
November 2002
|
this goes fine: string strMystring; this goes wrong: string GetTimeString(); error 'string' does not name a type I'm using dev-C++ any idea's or a quick work around.. I want to go on with my game Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
Jonatan Hedborg
Member #4,886
July 2004
|
moar coad!
|
Ariesnl
Member #2,902
November 2002
|
call me stupid but I don't get it Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
IonBlade
Member #3,521
May 2003
|
You aren't naming the string... Use: string strMystring = GetTimeString(); //or string strMystring(GetTimeString());
[EDIT] std::string GetTimeString(); ------ "I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima |
LennyLen
Member #5,313
December 2004
|
more code
|
Ariesnl
Member #2,902
November 2002
|
no ! I want to make a function GetTime string() that returns a string... string GetTimeString(); is just the declaration h and cpp file added Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
IonBlade
Member #3,521
May 2003
|
I looked at engine.h, looks like you aren't including <string> ------ "I've got to choose my words carefully so that I'm not misunderstood, but I think there are fewer developers around today who think about making a good game. As a creator, I find that sad..." - Hideo Kojima |
X-G
Member #856
December 2000
|
... you never actually include <string>, and you don't use the namespace. FAIL. -- |
Ariesnl
Member #2,902
November 2002
|
I include <string> in engine.cpp before engine.h but not using namespace could be the problem.. [edit] that does the job !!! thnx .. I need coffe I think Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
bamccaig
Member #7,536
July 2006
|
Ariesnl said: I include <string> in engine.cpp before engine.h... I think it would be more correct to include <string> in engine.h. **Shifty eyes** -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|