Mingw C++ string is not a type ??
Ariesnl

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 >:(

Jonatan Hedborg

moar coad!

Ariesnl

???

call me stupid but I don't get it

IonBlade

You aren't naming the string...

Use:

string strMystring = GetTimeString();

//or
string strMystring(GetTimeString());

[EDIT]
If you're trying to define a function prototype, maybe you need to put the namespace in? I'm not sure why you would have to if you're already using strings fine, but I haven't used Dev C++ in awhile...

std::string GetTimeString();

LennyLen

more code

Ariesnl

no ! I want to make a function GetTime string() that returns a string...

string GetTimeString(); is just the declaration

h and cpp file added

IonBlade

I looked at engine.h, looks like you aren't including <string>

X-G

... you never actually include <string>, and you don't use the namespace. FAIL.

Ariesnl

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 ::);D

bamccaig
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**

Thread #594252. Printed from Allegro.cc